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
 SQL Server Development (2000)
 Deactivating a trigger?

Author  Topic 

karuna
Aged Yak Warrior

582 Posts

Posted - 2006-02-07 : 04:37:22
Hi,

Is there a way to deactivate a trigger and activate them later?
or I dont want to my trigger to be executed during some circumstances, like when I run my batch jobs...

Thanks



Karunakaran

Kristen
Test

22859 Posts

Posted - 2006-02-07 : 04:46:33
ALTER TABLE dbo.MyTable DISABLE TRIGGER ALL
...
ALTER TABLE dbo.MyTable ENABLE TRIGGER ALL

Kristen
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 2006-02-07 : 04:56:33
quote:
Originally posted by Kristen

ALTER TABLE dbo.MyTable DISABLE TRIGGER ALL
...
ALTER TABLE dbo.MyTable ENABLE TRIGGER ALL

Kristen



Thanks Kristen... For a specific trigger, I guess, I have to the name of that trigger? will it affect other triggers on that table?

Karunakaran
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-07 : 08:28:31
BoL says:

ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER
{ ALL | trigger_name [ ,...n ] }

Kristen
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 2006-02-07 : 08:43:26
quote:
Originally posted by Kristen

BoL says:

ALTER TABLE table
{ ENABLE | DISABLE } TRIGGER
{ ALL | trigger_name [ ,...n ] }

Kristen



Yes, I checked in BOL. Thanks

Karunakaran
Go to Top of Page
   

- Advertisement -