0

I would like to know how can I take a user that modified a table/row and save this information into some temp log table.

Is it possible?

Thanks !

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121
ravenaot
  • 3
  • 1
  • 3
  • 2
    It depends in the database, but generally to see who modified a table (added a column, change a datatype), you need a DDL trigger. To see who changed data you need a standard trigger. These need to be installed beforehand. You can't find out afterwards. – Nick.Mc Jan 16 '17 at 11:32
  • See [SQL Server after update trigger](http://stackoverflow.com/a/35341698/1110897) – Serge Jan 16 '17 at 11:33
  • Built-In Change Tracking might also help: https://msdn.microsoft.com/en-us/library/bb933875.aspx – Stephan Lechner Jan 16 '17 at 11:37
  • You could implement audit tables, e.g. [Quick And Easy Audit Tables - Dave Britten](http://dave.brittens.org/blog/quick-and-easy-audit-tables.html) – SqlZim Jan 16 '17 at 13:50

0 Answers0