Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Create Log tables and Triggers

By Srinivasulu Nasam,

Usually in business applications it is necessary to maintain the history of the data being modified for auditing purposes or for later analysis. Proven way to achieve this is to create a log table for each datatable with an additional column "Action" to indicate what the user has done on the data (either insert, update or delete).
And a trigger will be created on the base data table to move the modified data to the log table

Below script helps the database developer to automatically create log tables and triggers on base tables automatically for all the database tables

Total article views: 3533 | Views in the last 30 days: 12
 
Related Articles
FORUM

Creating PK

Creating PK

FORUM

creating filegroup

creating filegroup

FORUM

create function

create function

FORUM

Create Permission in Schema

Create Permission

FORUM

can't create user

create user

Tags
miscellaneous    
t-sql    
 
Contribute