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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-03-15 : 08:20:02
Jorge writes "I from Costa Rica, sorry for my bad inglish !

How I do disable a trigger temporaly

For example: exist a trigger for insert in a table, but when a dts running for import data from other server, i don't want these trigger is fire.

I have this version:

Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: )

Tanks !"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-03-15 : 12:31:10
You can disable a trigger with ALTER TABLE statement:

ALTER TABLE trig_example DISABLE TRIGGER trig1
GO


But while the trigger is disabled, inserts on the table outside of your DTS package will not cause the trigger to fire. You should rethink the design of your system as this might cause problems.

Tara
Go to Top of Page
   

- Advertisement -