mssqlserver.com: FAQ: How do I audit what has been updated in a SQL Server?
 


Search
Home
Articles
Backup
Books
Certification
FAQ
Products
Replication
Scripts
Seminars
Training
TSQL

MSDN Fourms
Philippine SSUG
Fort Worth SSUG
Oklahoma City SSDG

Resume

MHS Enterprises
BlowFrog Software
FilAm Software
AcrylicAcetate.com
Bargain Humidors
Western Humidor

How do I audit what has been updated in a SQL Server?

The transaction log that SQL Server writes is not really useful for this purpose (see logview.txt in the faq for more information).

There are really two options :-
  1. SQL Trace/Profiler.
    SQL Server has built-in tracing facilities that can be used for an audit trail if required. You can set-up a trace to run automatically and to write output to a SQL table and/or flat file.
  2. Triggers.
    With this option you write insert/update/delete triggers on every table to audit all access you want. (There is no such thing as a read trigger). If the effort of writing 100's of triggers isn't appealing then you can get a 3rd party product that automates this for you - www.redmatrix.com

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.