Temporarily disable all triggers on a SQL Server DB

I need to disable all triggers temporarily on a SQL Server DB (2008) so I can run some insert scripts against it.   How can I do this with one statement?   I don't really feel like going through each individual trigger on 65 tables and disabling them.  Also, I need to know how to re-enable them when the scripts are done.   Thanks.
saturationAsked:
Who is Participating?
 
aelliso3Connect With a Mentor Commented:
--Disable all triggers
EXEC sp_MSforeachtable @command1="ALTER TABLE ? DISABLE TRIGGER ALL"

 
--Enable all triggers
EXEC sp_MSforeachtable @command1="ALTER TABLE ? ENABLE TRIGGER ALL"  
 
0
 
saturationAuthor Commented:
Perfect!
0
All Courses

From novice to tech pro — start learning today.