Thursday, November 21, 2024
HomeDatabaseSQL Server 2005: How to Disable a Trigger

SQL Server 2005: How to Disable a Trigger

A trigger allows for the execution of SQL code anytime an UPDATE, INSERT, or DELETE command is performed on a certain table. If you are having to perform manual modifications to the table, you may not want the trigger to fire off. Here’s how to disable the trigger so that you can perform your administrative tasks:


To disable the trigger, open a query window and use the following command (inserting the proper Table Name and Trigger Name into the statement):
ALTER TABLE <Table Name> DISABLE TRIGGER <Trigger Name>

To enable the trigger, use the following command (inserting the proper Table Name and Trigger Name into the statement):
ALTER TABLE <Table Name> ENABLE TRIGGER <Trigger Name>

Rob Rogers
Rob Rogers
Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!