all groups > sql server dts > may 2007 >
You're in the

sql server dts

group:

Stop/Restart trigger to execute SQL Task


Stop/Restart trigger to execute SQL Task Melina
5/30/2007 6:17:40 AM
sql server dts: I have a table which has an update trigger to keep the log's table. I need to do a bunk update and don't need to track the logs.
How can I stop the trigger before running my SQL Task (DTS) and re-start the trigger when the task is completed?

From http://www.developmentnow.com/g/103_2005_4_0_0_0/sql-server-dts.htm

Posted via DevelopmentNow.com Groups
RE: Stop/Restart trigger to execute SQL Task Melina
5/30/2007 9:42:41 AM
Got it.

alter table table_Name disable trigger all

Same to enable

alter table table_Name disable trigger all

From http://www.developmentnow.com/g/103_2007_5_0_0_976467/StopRestart-trigger-to-execute-SQL-Task.htm

Posted via DevelopmentNow.com Groups
Re: Stop/Restart trigger to execute SQL Task Russell Fields
5/30/2007 1:08:57 PM
Melina,

Yes, that is the correct syntax. But just a caution or two.

1 - If the triggers are doing anything "important" please remember that they
are disabled for everyone, so that important action will not take place for
other users. If this is the case, schedule your job for a period when you
are not expecting (or even not allowing) other updates.

2 - Disabling a trigger is a powerful metadata command. If it is done at
just the wrong moment, it can apparently cause another transaction which is
executing the trigger to enter into an anomolous state. (I have only seen
this provably happen once, but I had to restart the SQL service to clear
that transaction.)

RLF

[quoted text, click to view]

AddThis Social Bookmark Button