February 3, 2010 at 8:27 am
What's the best way to see any/all deletes on a table?
I have a table that somehow records are being deleted. The Dev's have asked me to try and determine where the deletes on this table are coming from.
I have set up a trace file that captures everything from that DB, but I was hoping to be able to limit my trace to use just the deletes.
February 3, 2010 at 8:33 am
You would have to scan the trace information for deletes. You could use a trigger to capture delete info and drop it in another table.
February 3, 2010 at 8:37 am
Okay kinda figured...
Thanks Steve.
February 3, 2010 at 8:50 am
Lol..
Okay should have asked this but..
How do I create a 'delete' trigger that sends any delete transaction on my table to a different table?
February 3, 2010 at 8:58 am
You need to decide what you want to capture. Then create a table store the info. (user, time, table, etc.)
Here are a couple examples on building a trigger:
http://www.sqlservercentral.com/articles/Administration/auditingyoursqlserverpart1/917/
http://www.sqlservercentral.com/articles/Triggers/triggersforauditing/2143/
http://www.sqlservercentral.com/articles/Triggers/auditingtriggers/579/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply