Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging a trigger 1

Status
Not open for further replies.

LonnieJohnson

Programmer
Joined
Apr 16, 2001
Messages
2,628
Location
US
I need to find out where a trigger is failing. This is an Insert Trigger that adds a record to another table if conditions are met. I have a number of conditions in the trigger. Can I send myself an alert so I can tell which conditions were met?



ProDev, Builders of Affordable Software Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
You could populate a log table from within the trigger.

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
If you are on SQL 2000 you can set up a stored procedure to do an insert and then use the debugger to step through it. The debugger will step into the trigger from the SP.
 
Thanks Tyson. Will it do the same in 2005?

ProDev, Builders of Affordable Software Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Nope...they took it away. If you have Visual Studio you can do it from there.
 
djj,

I ended up going with your deal and that helped me find where it was bugging out at.

Thanks.

ProDev, Builders of Affordable Software Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
We use triggers to track user changes to the database.

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top