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

Creating and Dropping Triggers

To create a trigger, you can use the CREATE TRIGGER statement. In this statement, you must provide the name of the trigger, the object where the trigger is defined, and the action or actions that will fire the trigger.

The CREATE TRIGGER statement must be executed as the only statement in a batch. The same restriction applies to the CREATE PROCEDURE, CREATE VIEW, CREATE RULE, and CREATE FUNCTION statements.

You can use the WITH ENCRYPTION option to encrypt the trigger definition. In this way, you can prevent user access to the trigger's internal code. Be careful when using this option, because there is no way to decrypt an encrypted trigger. It is recommended that you save the CREATE TRIGGER script in ...

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