Relative Content

Tag Archive for sqlsql-servertriggerssql-server-2019

Is it possible to access the SQL statement that caused the delete trigger to fire?

I have defined an AFTER DELETE SQL trigger on a table and I want to store information in another table. Therefore, I would like to also store the SQL statement that triggered the trigger. Is there a way to access this statement? Or something similar? I just don’t want to retrieve all that information by hand. Also, I might want to use the trigger on different tables.

MSSQL DELETE Trigger Access to SQL Statement

I have defined an SQL Trigger AFTER DELETE on a table and I want to store information in another table. Therefore I would like to also store the SQL Statement, that triggered the Trigger 😉 Is there a way to access this statement? Or something similar? I just don’t want to retrieve all that information by hand. Also, I might want to use the trigger on different tables…