Programming in MS SQL Server 2012

DROP Trigger



DROP TRIGGER statement is used to delete existed trigger from user-defined database that trigger information removed from the sys.objects, sys.triggers and sys.sql_modules catalog view. Implicitly, SQL Server drop trigger(s), when drop particular table from user-defined database.
The following example describes to drop existed DML trigger object.

-- Example 140 --

 

USE EBusiness

GO

 

IF OBJECT_ID ('dbo.DMLProductTableTrigger','TR') IS NOT NULL

    DROP TRIGGER dbo.DMLProductTableTrigger;

GO


Query Output Screen

The following example describes to drop existed DDL trigger object.

-- Example 141 --

 

USE EBusiness

GO

 

IF EXISTS (SELECT * FROM sys.triggers

    WHERE parent_class = 0 AND name = 'DDLControlTrigger')

    DROP TRIGGER DDLControlTrigger ON DATABASE;

GO


Query Output Screen

* * * * *


Email Your Comment To AUTHOR