SQL Trigger Nest Level

if TRIGGER_NESTLEVEL() > 1 begin
    return
end

 

The above returns the next level of all triggers. It is possible to bounce around from table to table. 

This returns the nest level of the SPECIFIC TABLE THAT WE'RE TRIGGERING. It's more specific

 

PRINT @@PROCID
 
if trigger_nestlevel(@@PROCID) > 1 begin
    return
END

The print statement above return this:

472476903

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences