Skip to content

doxakis/Generic-SQL-Audit-Trail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Generic SQL Audit Trail

A generic audit trail based on triggers and dynamic SQL.

The SQL trigger has been designed to analyze your table. So, the database schema can change over time and it still works fine.

Whenever you add new table(s), you just have to run again the SQL script.

For more detail, please read this post: https://doxakis.com/2015/12/17/SQL-Script-Audit/

Setup

  • Execute the script: Audit trail script for SQL Server Database.sql on the selected database in Microsoft SQL Server Management Studio.
  • Check the printed messages and make sure the query has been executed successfully.

Customization:

You can exclude tables in the script.

  • Follow comments in the script: "Specify table to exclude here:"

Limitations:

Steps

  • Remove all triggers starting with "tr_audit_"
  • Add "Audit" table if not found on the database
  • Add triggers for almost all tables (this can be customized).

Copyright and license

Code released under the MIT license.

About

A generic audit trail based on triggers and dynamic SQL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages