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

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...