Trigger Question

Does anyone know how to capture the name of the procedure that invokes a trigger from inside of the trigger I would like to be able to do it without having to change any procedure code, if possible. It seems like there would be a way to do it in 2005 using DMVs, but I haven't figured it out yet.
Thanks,
Tim



Answer this question

Trigger Question

  • tackett

    Yeah, I knew about setting CONTEXT_INFO, I was just hoping there was an easy way to look it up in 2005. Thank you.
    Tim


  • Metaferia

    Nope, I don't think there is a reasonable way to do this. You could use SET CONTEXT_INFO to set the name of a proc when it is called, or a table to contain the stack of things being called along with a spid, but it really is way more trouble than it is worth.

  • Trigger Question