Re: @@NESTLEVEL

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 08/05/04


Date: Thu, 05 Aug 2004 16:07:38 +0200

On Thu, 5 Aug 2004 05:57:42 -0700, x-rays wrote:

>Hello Experts,
>
>Can I use The @@NESTLEVEL to find the stack of a trigger?
>I test it and i seems to work fine.
>
>Thanks in advance

Hi x-rays,

You can use @@NESTLEVEL, but be aware that this counts all nesting levels.
A trigger calling a proc doing an update that fires a trigger would yield
the same nestlevel as a manually started proc calling a proc doing an
update.

If you want to be sure about the nesting level of triggers only, use the
builtin function TRIGGER_NESTLEVEL() instead.

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)


Relevant Pages

  • Re: SQL 2005 Management Studio - no more user-defined keyboard shortcu
    ... if I set Ctrl+3 to trigger a system proc such as ... as a keyboard shortcut, and it worked fine......I could just highlight ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (microsoft.public.sqlserver.tools)
  • Re: TransferText command failing !?!
    ... - trigger it by encountering an error ... - entering it because there's no exit function or exit sub before the error ... check if err.number is being reset with err.clear before it reaches ... your msgbox or if it's being reset by leaving the proc, ...
    (microsoft.public.access.externaldata)
  • Re: TransferText command failing !?!
    ... - trigger it by encountering an error ... - entering it because there's no exit function or exit sub before the error ... check if err.number is being reset with err.clear before it reaches ... your msgbox or if it's being reset by leaving the proc, ...
    (microsoft.public.access.externaldata)
  • RE: How do I create a trigger in a stored procedure?
    ... Assuming you have good reason for doing it in a proc, ... Delete existing trigger on TableA ... SET LanguageText = REPLACE) ... Inner Join deleted d On i.LookupID = d.LookupID And i.LanguageText ...
    (microsoft.public.sqlserver.programming)
  • Re: Trigger debugging
    ... Write a proc which fires that trigger and debug that proc. ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.tools)

Loading