Keep track as data changes

vnarod

Well-known member
Joined
Mar 22, 2002
Messages
84
I need to store an old and new record in audit table (Sybase)every time data changes. All changes are done using ExecuteNonQuery method passing SQL statement.
So if I need to "DELETE TABLE1 WHERE Value=a" I have to do
"SELECT * FROM TABLE1 WHERE Value=a" first and write result to an audit table. Is there an easier way to solve this problem?
 
The short answer is no.

You could write a trigger for each table and have it write to the audit log - thats fairly common.

Ive done what you mention (SELECT, DELETE, SELECT again) to handle auditing in the past. Its not bad, but it just "feels" wrong somehow...

-Nerseus
 
Back
Top