Disable a trigger in SQL Server

Introduction


In order to disable a trigger in SQL Server, we use the DISABLE TRIGGER command.

DISABLE TRIGGER


The DISABLE TRIGGER command allows you to disable an enabled trigger contained within a table or a view.

Example


Following is an enabled insert trigger contained within a Comment table.

an enabled trigger

In order to disable the insertComment trigger, we will perform the following query:

DISABLE TRIGGER insertComment ON Comment

Using SQL Server Management Studio


We can also use SSMS to disable a trigger:

1- Locate the trigger you want to disable inside the triggers folder.

an enabled trigger

2- Right-click on the trigger and choose the Disable option.

right-click on the trigger and choose the disable option

3- After it's done, click the Close button.

click the close button

4- Refresh the Triggers folder to see the result.

refresh the triggers folder

Note: this feature is not available in SQL Server Express Edition.

See also