Problem solve Get help with specific problems with your technologies, process and projects.

Writing a generic audit trail trigger in SQL Server

Writing a generic audit trail trigger in SQL Server to keep track of inserts, deletes, and updates within a table is explained in this expert response.

How do you write an audit trail trigger in SQL Server 2000? I want to keep track of inserts, deletes and updates of all of the tables in a particular database.
Writing a generic audit trail trigger in SQL Server can be a bit tricky, as it requires manipulation of a bitmask exposed by the COLUMNS_UPDATED function. You'll also need to figure out how to store disparate data types in some generic fashion, which might be difficult if your database uses TEXT, NTEXT, or IMAGE columns.

Luckily, SQL Server MVP Nigel Rivett has already done most of the work. You can find his audit trigger at Nigel's...

Web site.

This was last published in May 2006

Dig Deeper on Microsoft SQL Server Performance Monitoring and Tuning

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.