Dropping Triggers
Go Up to Triggers (Data Definition Guide)
During database design and application development, a trigger may no longer be useful. To permanently remove a trigger, use DROP TRIGGER.
The following restrictions apply to dropping triggers:
- Only the creator of a trigger can drop it.
- Triggers currently in use cannot be dropped.
To temporarily remove a trigger, use ALTER TRIGGER and specify INACTIVE in the header.
The DROP TRIGGER syntax is as follows:
DROP TRIGGER name;
The trigger <name> must be the name of an existing trigger. The following example drops the trigger, SET_CUST_NO:
DROP TRIGGER SET_CUST_NO;
You cannot drop a trigger if it is in use by a CHECK constraint (a system-defined trigger). Use ALTER TABLE to remove or modify the CHECK clause that defines the trigger.
- Note: Direct metadata operations, such as dropping triggers, increase the metadata version. At most 255 such operations can be performed before you must back up and restore the database.