Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone;

I have a db in SQLServer and want an audit log file that could reveal every single operation perfomed on that database since it was created. This is to let me know if someone has deleted a record or modified directly using SQL server and not via application sitting on the database.

Does SQLServer has that facility?
Posted
Updated 28-May-13 4:59am
v2

SQL Server has an Activity Monitor that can identify which application opened a session ... see http://msdn.microsoft.com/en-us/library/ms175518.aspx[^]
 
Share this answer
 
Comments
Maciej Los 28-May-13 11:57am    
Short and to the point!
+5
The Built-in SQL Server Auditing[^] (see also: http://www.dbsimplified.com/2011/10/auditing-in-sql-server.html[^]) from v2008 is a really useful tool, but it is limited to Enterprise, Developer, and Evaluation editions (http://msdn.microsoft.com/en-us/library/cc280386.aspx[^]). Now, here you have a comparison of your possibilities: http://www.slideshare.net/sqlserver.co.il/a-comparative-analysis-of-auditing-solutions-in-sql-server[^].
If you have an other edition, or older server version, you can use tracing approach: http://sqlmag.com/sql-server-2005/get-compliant-sql-server-2005-audit-logging[^].
You could also make use of the SQL Server Extended Events.[^].
And of course you can make use of dml triggers, but that has it's limitations also, see: http://sql-box.com/2011/07/10/track-dml-changes-using-after-trigger-for-update-delete-and-insert-rows-capture-changed-data-rows-using-t-sql/[^] and Quick SQL Server Auditing Setup[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900