Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disabling trigger

Status
Not open for further replies.

fixthebug2003

Programmer
Oct 20, 2003
294
US
Hi ,
is there a way is disable and enable a trigger on a table in SQL server..is so..how?
Thanks
Fixthebug2003
 
Permenantly would be to DROP the trigger... !

I said DISABLE ..meaning Trigger exists in the database as an object ..but does not fire..!

And what do you mean "just for a life of a proc"?

Thanks,
fixthebug2003
 
Calm down was only trying to understand ur use of it.
life of a proc as in if u had a proc doing a load of stuff and u didnt want any triggers to fire while it was doing it.


ALTER TABLE tableX DISABLE TRIGGER triggerY

that will do it

ALTER TABLE tableX ENABLE TRIGGER triggerY

strangly enough turns it back on





 
-- Disable the trigger.
ALTER TABLE tableName DISABLE TRIGGER triggerName
.
.
.
code
.
.
.
-- Re-enable the trigger.
ALTER TABLE tableName ENABLE TRIGGER triggerName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top