Navigation

Friday, May 14, 2010

How to disable or enable all triggers in a database

I am a big fan of database triggers especially for audit records.  The problem is sometimes we need to import data into a database and don’t want the triggers firing during the migration.

These two scripts allow you to disable and enable all the triggers in a database.

GO
DISABLE Trigger ALL ON ALL SERVER;
GO

GO
ENABLE Trigger ALL ON ALL SERVER;
GO

This post shows a script for displaying all the triggers in a database;

http://justinpdavis.blogspot.com/2010/04/get-all-triggers-in-sql-database.html

No comments: