SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Deactivating a trigger?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

karuna
Aged Yak Warrior

581 Posts

Posted - 02/07/2006 :  04:37:22  Show Profile  Send karuna a Yahoo! Message  Reply with Quote
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

United Kingdom
22403 Posts

Posted - 02/07/2006 :  04:46:33  Show Profile  Reply with Quote
ALTER TABLE dbo.MyTable DISABLE TRIGGER ALL
...
ALTER TABLE dbo.MyTable ENABLE TRIGGER ALL

Kristen
Go to Top of Page

karuna
Aged Yak Warrior

581 Posts

Posted - 02/07/2006 :  04:56:33  Show Profile  Send karuna a Yahoo! Message  Reply with Quote
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

United Kingdom
22403 Posts

Posted - 02/07/2006 :  08:28:31  Show Profile  Reply with Quote
BoL says:

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

Kristen
Go to Top of Page

karuna
Aged Yak Warrior

581 Posts

Posted - 02/07/2006 :  08:43:26  Show Profile  Send karuna a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000