Retrieve name of Trigger

  • I have approximately 30 tables that each have a near identical trigger. To help in error reporting and debugging, I'd like each trigger to output it's own name if it throws a RAISERROR, and obviously I'm looking to automate this and not hard-code it for each one. How can I access the trigger's name so that I can pass it back in the text portion of RAISERROR's parameters?

    Thanks in advance for any insight.

  • dansell (8/22/2008)


    I have approximately 30 tables that each have a near identical trigger. To help in error reporting and debugging, I'd like each trigger to output it's own name if it throws a RAISERROR, and obviously I'm looking to automate this and not hard-code it for each one. How can I access the trigger's name so that I can pass it back in the text portion of RAISERROR's parameters?

    Thanks in advance for any insight.

    USE:

    OBJECT_NAME(@@procid)

    And you are good to go!


    * Noel

  • Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply