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 ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.