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

Altering Trigger Definitions

To modify the definition of a trigger, you can use the ALTER TRIGGER statement. In this case, the trigger will take the new definition directly. Listing 9.17 shows how to execute the ALTER TRIGGER statement to modify the tr_Employees trigger.

The syntax is identical to the CREATE TRIGGER statement. Moreover, because triggers are independent objects, no objects are depending on them. They can be dropped and re-created any time, if necessary.

Caution

You can change the name of a trigger using the sp_rename stored procedure, but this does not change the name of the trigger stored in the definition of the trigger in syscomments.

To rename a trigger, it is recommended to drop the trigger and re-create it with a ...

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