Enterprise Edition Home |
Express Edition Home |
Previous Page | Next Page SQL Statements > CREATE TRIGGER >
You can set a trigger mode to enable or disable a trigger when you
create it.

Trigger Modes
.-ENABLED--.
>>-+-DISABLED-+------------------------------------------------><
You can create triggers on tables or on views in ENABLED
or DISABLED mode.
- When a trigger is created in ENABLED mode, the database server executes
the trigger action when the trigger event is encountered. (If you specify
no mode when you create a trigger, ENABLED is the default mode.)
- When a trigger is created in DISABLED
mode, the trigger event does not cause execution of the trigger action. In
effect, the database server ignores the trigger and its action, even though
the systriggers system catalog table maintains information
about the disabled trigger.
You can also use the SET TRIGGERS option of the Database Object Mode statement
to set an existing trigger to the ENABLED or DISABLED mode.
After a DISABLED trigger is enabled by the SET TRIGGERS statement, the
database server can execute the trigger action when the trigger event is encountered,
but the trigger does not perform retroactively. The database server does not
attempt to execute the trigger for rows that were selected, inserted, deleted,
or updated while the trigger was disabled and before it was enabled.
Warning:
Because the behavior of a trigger varies according
to its ENABLED or DISABLED mode, be cautious about disabling a trigger. If
disabling a trigger will eventually destroy the semantic integrity of the
database, do not disable the trigger.
Enterprise Edition Home |
Express Edition Home |
[ Top of Page | Previous Page | Next Page | Contents |
Index ]