progressive
progressive

Reputation: 71

How To Verify or Test If a Trigger was fired in SQL Server

We have a trigger in SQL Server that is supposed to be fired on DML SQL queries i.e. when a value for column in a table is updated. Is there a way to verify that the trigger was actually fired ? I am looking for a SQL query or a log file that keeps record of any triggers that were fired.

Thanks

Upvotes: 6

Views: 15386

Answers (1)

jokedst
jokedst

Reputation: 344

No, there is no such thing that I know of.

To test if a trigger fires you can add a PRINT statement to the trigger (e.g. "PRINT 'trigger fired!'"), then do something that should trigger the trigger. If you get the printed text in your messages-tab in management studio you know it fired.

Upvotes: 9

Related Questions