January 2, 2013

All Trigger are Enable/Disable by single query


 -- disable all triggers Sql
EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE TRIGGER ALL"

-- Enable all triggers Sql
EXEC sp_MSforeachtable @command1="ALTER TABLE ? ENABLE TRIGGER ALL"


-- Disable single table and single trigger
ALTER TABLE DemoTrg DISABLE TRIGGER utrDemo

-- Enable single table and single trigger
ALTER TABLE DemoTrg ENABLE TRIGGER utrDemo