www.allfree-stuff.com


Friday, December 26, 2008

How To Disable a Trigger SQL Server 2005

How To Disable a Trigger SQL Server 2005

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: