Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #844

Re: Get trigger name inside trigger (reflection)

From Necoc Yaotl <tezcatlipoca1427@gmail.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Get trigger name inside trigger (reflection)
Date 2011-11-24 18:04 -0800
Organization http://groups.google.com
Message-ID <0c1bb61b-0b0a-4e24-9d2d-97d421c03c6b@gi1g2000vbb.googlegroups.com> (permalink)
References <e726eebf-685d-419d-90ce-39bbee3fe9c4@da3g2000vbb.googlegroups.com> <Xns9FA75E06E4F8AYazorman@127.0.0.1>

Show all headers | View raw


On Nov 24, 3:14 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
> Necoc Yaotl (tezcatlipoca1...@gmail.com) writes:
> > Inside a trigger, is there a way to get the name of that trigger? (in
> > SQL Server 2000).
>
> > Something like:
>
> > create trigger my_trigger on my_table for update
> > as
>
> > declare @current_trigger_name varchar(100)
>
> > select @current_trigger_name = some_function()
>
> You can use @@procid which returns the object id for the currently runnnig
> module which you can pass as a parameter. You can then use the
> function object_name() to get the name of the trigger.
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Thank you!

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

Get trigger name inside trigger (reflection) Necoc Yaotl <tezcatlipoca1427@gmail.com> - 2011-11-23 20:32 -0800
  Re: Get trigger name inside trigger (reflection) Erland Sommarskog <esquel@sommarskog.se> - 2011-11-24 08:14 +0000
    Re: Get trigger name inside trigger (reflection) Necoc Yaotl <tezcatlipoca1427@gmail.com> - 2011-11-24 18:04 -0800

csiph-web