I am wondering if something can be done. I have a large database that I would like to implement change tracking on selected tables. We've come up with a way to do it the least painful way we can, but I do not know if it will work.
I've created a trigger that will pass the table name to a stored procedure. That stored procedure creates a Tracking table by appending the suffix 'Changes' to the past in table name. But now how do I get the data from the Deleted table?
I can't do a SELECT INTO or INSERT INTO because the tables have timestamp fields and blobs. I don't care if I do net get the data from those fields but I don't want to have to enter all the field names besides those two types. I can make a stored
procedure get the column names and types from a system table and dynamically build the SQL. But I would prefer to do that in one place instead of each trigger.
Basically the problem is how do I get the data from the Deleted table to another stored procedure without explicitly naming all \the fields in the trigger.
If you don't understand what I mean then please ask, I will clarify with examples.
View Complete Post