SQL Server Performance

Debug Triggers

Discussion in 'Third Party Tools' started by dineshasanka, Nov 28, 2005.

  1. dineshasanka Moderator

  2. ghemant Moderator

    Hi,<br />AFAIK no but as you know we can use RAISERROR ...<br /><br /><img src='/community/emoticons/emotion-1.gif' alt=':)' /><br />Regards<br /><br />Hemantgiri S. Goswami<br />ghemant@gmail.com<br />"Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemantgiri S. Goswami<br />
  3. Adriaan New Member

    No need for third party software ...

    Create a stored procedure just for testing, which will do an insert/update/delete on the table for which you want to debug the trigger.

    From Query Analyzer, right-click the test procedure and select "Debug procedure". You will see the trigger code appearing in the debug window like any other procedure.
  4. Madhivanan Moderator

    Good Logic Adriaan [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]<br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
  5. Adriaan New Member

    Another surprise, perhaps, is that when you have a UDF as a default constraint on the target table, or included in a query, then you will also see the UDF code come up - in fact it comes up for each row, so the debugging experience can be a bit repetitive ...
  6. Adriaan New Member

    ... and another one is that if you have a cascading relationship from the target table, then you will see any triggers and UDFs getting debugged as well.
  7. dineshasanka Moderator

    That is how I am doing right now. But when ever there are changes I need to update the sp. I was looking to overcome that problem. [<img src='/community/emoticons/emotion-11.gif' alt='8)' />]<br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Adriaan</i><br /><br />No need for third party software ...<br /><br />Create a stored procedure just for testing, which will do an insert/update/delete on the table for which you want to debug the trigger.<br /><br />From Query Analyzer, right-click the test procedure and select "Debug procedure". You will see the trigger code appearing in the debug window like any other procedure.<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />----------------------------------------<br /<a target="_blank" href=http://spaces.msn.com/members/dineshasanka>http://spaces.msn.com/members/dineshasanka</a><br />
  8. Adriaan New Member

    I can understand why you would like to have a graphic interface, but surely you are clever enough to make the necessary changes to your test procedure all by yourself?[8D]
  9. dineshasanka Moderator

  10. Adriaan New Member

    As long as that bit doesn't grow up to be a byte, you should be safe.

Share This Page