September 14, 2009 at 2:37 pm
Hi,
i want to use a trigger on a table to capture all delete activities on that table.
i want to capture the loginame,spid,command issue.
i try to use the EVENTDATA() to collect this info but all it give me is a NULL values.
how can i capture this data on delete from table.
THX.
September 14, 2009 at 7:52 pm
You have to write your trigger.
you can get SPID and user information by using system variables.
SELECT @@SPID AS 'ID', SYSTEM_USER AS 'Login Name', USER AS 'User Name'
September 14, 2009 at 11:38 pm
what are my options to capture the issue command on the deleted rows from the table?
THX
September 15, 2009 at 12:41 am
quick answer is, eventdata is used to capture event information for DDL events and used in DDL Triggers, you want to return the command for a DML Trigger.
--------------------------------------------------------------------------------------
[highlight]Recommended Articles on How to help us help you and[/highlight]
[highlight]solve commonly asked questions[/highlight]
Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
Managing Transaction Logs by Gail Shaw[/url]
How to post Performance problems by Gail Shaw[/url]
Help, my database is corrupt. Now what? by Gail Shaw[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply