Possible Duplicate:
Create Trigger to log SQL that affected table?
Is possible in SQL Server 2008 to write a trigger which will put into my log table the query which triggered it? I will explain it on the example:
I have a table, TAB1, and log table LOG. I execute query which deletes rows from TAB1 and I want to have that query (or something else what could help me to identify who executed delete query on TAB1) in my LOG table.
Any idea how this can be achieved?