Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Audit Trail Tables

$
0
0
We have been asked to add audit trails to about 20 tables in our sql 2016 database to be able to identify who inserted, changed or deleted data in each table.  I have seen solutions that use a single table to identify table, column, old data, new data, etc.  I was thinking that it would be easier to simply create 20 audit tables, one for each table to track, and then simply write out the old row prior to change and include username and datetime to identify who made the change.  I would include in a trigger the insert to this audit table(s) when a row was inserted, changed or deleted.  The database is not huge, maybe 1-2 GB in size so I am not concerned with growth that much. Any ideas on this?

Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>