Home Database SQL Server 2005: How to Disable a Trigger

SQL Server 2005: How to Disable a Trigger

0
724

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>

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

error: Content is protected !!