SQL SERVER – DISABLE/ENABLE ALL TRIGGERS IN A DATABASE

Recently I came across a situation to disable all triggers in a database .The query is

  • Disable all Triggers in a database:

EXEC Sp_msforeachtable  ‘ALTER TABLE ? DISABLE TRIGGER ALL’ 
 
 

  • Enable all Triggers in a database:

  • EXEC Sp_msforeachtable  ‘ALTER TABLE ? ENABLE TRIGGER ALL’