Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Script to disable triggers

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-10-18 : 12:42:51
We have audit triggers attached to each database. These triggers need to be disabled before running large INSERT scripts. Most of the time, i will remember to manually disable these triggers, but i'm wondering if i can code something in my queries for my INSERT's which will disable these at the beginning of the script and reenable them at the end of the script.

thanks

James

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2011-10-18 : 13:04:06
Disregard. Figured it out.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-19 : 05:13:07
if you're using BULK INSERT triggers will be disabled by default

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -