Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 463
progressive Avatar asked Jun 05 '14 05:06

progressive


1 Answers

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.

like image 164
jokedst Avatar answered Oct 01 '22 08:10

jokedst