March 6, 2003 at 11:12 pm
I have a table, i want to make a log of update information , for ex if some data is modified from some value to other i want to make a log of the data which is modified.
Thanx.
March 7, 2003 at 3:00 am
Use triggers and store the log in a second table.
CREATE TRIGGER xyz
ON updatetable
FOR UPDATE
AS
INSERT INTO logtable
SELECT * FROM inserted
inserted is a special virtual table that contains all rows that where updated (their new values). Change this to whatever you want to log, Check Books Online for more info on inserted, deleted (virtual table with old data for rows that where modified) and CREATE TRIGGER in general.
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply