SQL SERVER – How to Enable or Disable All the Triggers on a Table and Database?

Here is the quickest way to disable all the triggers for a table. Please note that when it is about the table, you will have to specify the name of the table. However, when we have to enable or disable trigger on the database or server, we just have to specify word like database (and keep the current context of the database where you want to disable database) and all server.

Enable Triggers on a Table

ENABLE TRIGGER ALL ON TableName;  

Enable Triggers on a Database

ENABLE TRIGGER ALL On DATABASE;  

Enable Triggers on a Server

ENABLE TRIGGER ALL ON SERVER;  

Disable Triggers on a Table

DISABLE TRIGGER ALL ON TableName; 

Disable Triggers on a Database

DISABLE TRIGGER ALL ON DATABASE; 

Disable Triggers on a Server

DISABLE TRIGGER ALL ON SERVER;  

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Scripts, SQL Trigger
Previous Post
SQL SERVER – Configure the Backup Compression Default Server Configuration Option
Next Post
Interview Question of the Week #035 – Different Ways to Identify the Open Transactions

Related Posts

Leave a Reply