While looking at some tables in my schema, it occured to me if I could create a global audit table, which might contain some information on DML entries on all tables. I'd like to store 'Table name', 'Modifier', 'Row Update/Insert/Delete query', 'query result', 'Modifying Instance Information: sql-client, session-info(?)', performance items, timestamp, etc
. I could also limit this table-size by limiting number of rows through a insert trigger
on this table through rowcount
. Is this construct allowed? Is this a bad idea? What is the fastest it could get? What more problems does construct like this present? Basically, is direct logging into database a bad idea?
Asked
Active
Viewed 482 times
0

user2338150
- 479
- 5
- 14
1 Answers
1
Logging DML with database level trigger
on big data and bulk insert/update/delete
have a performance issue, so there is three other option :
- SQL server Change Tracking : more info
- Build-in data changes function (CDC) : more info
- Database level Audit Log : more info
And i strongly preferred option no 1.

XAMT
- 1,515
- 2
- 11
- 31
-
1Thanks for the answer, I had a bike crash the evening later, so I couldn't get to see it. I shall read about the respective topics. – user2338150 Dec 27 '19 at 06:11
-
@user2338150; that's ok – XAMT Dec 27 '19 at 07:11