SQL - Trigger Template

This article contains code for a trigger template.

I work for 4 or 5 customers a day on support calls, I'm coding on their system remotely; I don't have the luxury of setting up SQL Server SSMS the way that I like it and coding blissfully.

A basic task for me would be creating a trigger; but I really don't like the templates that come with SQL. 

 

IF OBJECT_ID ('dbo.ddt_','TR') IS NOT NULL
   DROP TRIGGER dbo.ddt_ 
GO
  
CREATE TRIGGER dbo.ddt_ 
    ON IV00102
    FOR INSERT, UPDATE, DELETE
       
AS
   
if TRIGGER_NESTLEVEL() > 1 begin
    return
end
   
 
   
 
GO

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