O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Disabling Triggers

To prevent triggers from running when data arrives through replication, you can add the NOT FOR REPLICATION option to the CREATE TRIGGER or ALTER TRIGGER statements. In this case, the trigger will fire on direct modifications to the base table, but not from subscription actions.

Temporarily, you can disable a trigger to speed up some processes. To do so, you can use the ALTER TABLE statement with the DISABLE TRIGGER option, as in Listing 9.18.

Code Listing 9.18. You Can Disable a Trigger
					 USE Northwind GO -- To disable a single trigger ALTER TABLE Employees DISABLE TRIGGER tr_Employees --, isr_Employees, udt_Employees ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required