Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 original triggering query from within a triger

Author  Topic 

gindyo
Starting Member

2 Posts

Posted - 2011-03-13 : 16:50:55
My question is do I have an access to the original triggering query from within a trigger. for example if my query was:
delete from a where id=4 and usename="name"
and I had a trigger that triggers at a DELETE operation on that table, can I, from within the trigger extract the username="joe" part of the query, if the query returned no results(was not successful because there was no record with "joe" in the "username"field) and deleted table is empty.

gindyo
Starting Member

2 Posts

Posted - 2011-03-13 : 18:52:12
I found my answer here: http://bytes.com/topic/sql-server/answers/808392-capture-save-running-sql-query-database-table-logging
Go to Top of Page
   

- Advertisement -