Updated on 2024-05-07 GMT+08:00

DROP TRIGGER

Function

DROP TRIGGER deletes a trigger.

Precautions

Only the trigger owner or a user granted with the DROP ANY TRIGGER permission can run the DROP TRIGGER command. The system administrator has this permission by default.

Syntax

DROP TRIGGER [ IF EXISTS ] trigger_name ON table_name [ CASCADE | RESTRICT ];

Parameter Description

  • IF EXISTS

    Reports a notice instead of an error if the specified trigger does not exist.

  • trigger_name

    Specifies the name of the trigger to be deleted.

    Value range: an existing trigger name

  • table_name

    Specifies the name of the table containing the trigger.

    Value range: name of the table containing the trigger

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes the objects that depend on the trigger.
    • RESTRICT: refuses to delete the trigger if any objects depend on it. This is the default action.

Examples

For details, see Examples in CREATE TRIGGER.