October 22, 2010 at 10:54 am
Is there a way to run a T-SQL INSERT command and turn off triggers for the insert? I know I can disable the trigger but I am supporting a call center that uses the trigger all the time. I need to disable just for the one run of an inserts.
The data was originally in the main database and archived. They changed the archive rules so I need to put some rows back without changing the triggers and disrupting the Call Center's inserts.
Thanks for the help,
Steve
October 22, 2010 at 11:14 am
You could probably run the disable and enable in the same context as the insert and get it that way, but it doesn't guarantee results.
Any problem with just inserting, and then fixing the results of the triggers?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 22, 2010 at 11:19 am
I'll take that as a no there is no direct way. I will investigate the triggers. I am being told they are rather complex.
October 26, 2010 at 6:56 am
Something I just thought of: Triggers don't usually fire for bulk inserts. Can you test importing from a text file using a bulk import method? Might seem silly for just a few rows of data, but will usually bypass triggers, and can be configured to do so in the import statement.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply