Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 debugging triggers

Author  Topic 

jrervin
Starting Member

2 Posts

Posted - 2002-06-03 : 14:39:05
I'm having problems writing a trigger and would like to echo some values as the trigger runs to see what's going on in its little head. I've tried the print statement, but I get no output and the trigger seems to halt execution at print. How can I get such diagnostic output?

Radhika
Starting Member

15 Posts

Posted - 2002-06-03 : 15:35:46
I have a similar situation, but i use the debugging in terms of creating a table (this table is just the work table of the trigger process) that has columns like Trigger_Name (value = INSERT, UPDATE, DELETE), DateTime Stamp, Previous_Value, Current_Value and in ur trigger a step of code thats logs on to this trigger table every time the trigger is fired. Later you can query against this table to find what exactly happend in the trigger. This table can also include ur unique col value like ID,... that will also identify the record you are looking for. once you do ur debugging, u can clean off this table.



quote:

I'm having problems writing a trigger and would like to echo some values as the trigger runs to see what's going on in its little head. I've tried the print statement, but I get no output and the trigger seems to halt execution at print. How can I get such diagnostic output?



Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-03 : 15:42:32
assuming you are doing you dml (insert/update/delete) that fires the trigger in QA, you should certainly see the print statements . . . maybe your error is occuring b4 the print . . . Have you tried tracing SQL Statements in profiler?


<O>
Go to Top of Page
   

- Advertisement -