Enable a trigger in SQL Server

Introduction


In order to enable a trigger in SQL Server, we use the ENABLE TRIGGER command.

ENABLE TRIGGER


The ENABLE TRIGGER command allows you to enable a disabled trigger contained within a table or a view.

Example


Following is a disabled insert trigger contained within a Comment table.

a disabled trigger

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

ENABLE TRIGGER insertComment ON Comment

Using SQL Server Management Studio


We can also use SSMS to enable a trigger:

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

a disabled trigger

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

right-click on the trigger and choose the enable 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