Drop and Disable trigger using query in SQL Server

Drop Trigger: We can drop trigger using following query.

Example:


USE [DB_NAME]
GO
DROP TRIGGER TGGR_NAME
GO


Disable Trigger: You can disable/enable trigger using following query

Example:



--Disable trigger
USE [DB_NAME]
GO
DISABLE TRIGGER TGGR_NAME ON TBL_NAME

--Enable trigger
USE [DB_NAME]
GO
ENABLE TRIGGER TGGR_NAME ON TBL_NAME

No comments:

Post a Comment

PostgreSQL-Query: Sort result set by specific field values using ORDER BY Clause

Problem: Suppose we have a book_inventory table which has some columns such as id, isbn, title, author, publisher, publish_date, etc.. whe...