Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintain History of changes

Status
Not open for further replies.

olibh

Programmer
Mar 21, 2002
13
0
0
IE
Hi,

I'm new to SQL Server (ver 7)and would appreciate any help with the following - I wanted to capture every action that occurred on a particular table, such as who modified the record, what kind of modification took place, and when the record modification occurred. What is the best way to go about this.
 
This is almost always accomplished by using triggers. These are basically specialized stored procedures that are invoked automatically whenever specified actions - Update, Insert, Delete - are done on table. Within the trigger, you write t-sql code to do whatever you want - like writing out a new record to an audit file that records the changes.

You can write your own trigger(s), esp for a straight-forward situation like this.; if you had a whole ton of them to do, though, there are 3rd-party products available to help construct/maintain the appropriate triggers on a whole bunch of tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top