posts - 230, comments - 423, trackbacks - 27

My Links



Follow billgraziano on Twitter

Article Categories


Post Categories


SQL Server

Testing Triggers

I hate testing triggers.  It's a pain to figure out what's going on inside the code.  Especially when you're dealing with the inserted and deleted tables.  There are two great tricks I always forget.  The first is the SQL Debugger built into Query Analyzer.  Create a stored procedure to make the database change that fires the trigger.  Call this procedure in the debugger and it will step through the procedure AND the trigger(s).  The second trick is that Profiler can show you each statement inside a stored procedure that executes.  And this also shows each statement that executes inside a trigger.  Not as informative as the debugger but still pretty handy.

Print | posted on Monday, September 29, 2003 11:04 AM | Filed Under [ SQL Server Stuff ]

Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET