All pages
Powered by GitBook
1 of 1

Loading...

DROP TRIGGER

Remove a trigger from a table. This command deletes the trigger definition, preventing it from firing on future INSERT, UPDATE, or DELETE events.

Syntax

Description

This statement drops a trigger. The schema (database) name is optional. If the schema is omitted, the trigger is dropped from the default schema. Its use requires the TRIGGER privilege for the table associated with the trigger.

Use IF EXISTS to prevent an error from occurring for a trigger that does not exist. A NOTE is generated for a non-existent trigger when using IF EXISTS. See .

Note: Triggers for a table are also dropped if you drop the table.

Atomic DDL

DROP TRIGGER is .

DROP TRIGGER is not .

Examples

Using the IF EXISTS clause:

See Also

This page is licensed: GPLv2, originally from

DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
SHOW CREATE TRIGGER
  • Trigger Limitations

  • SHOW WARNINGS
    atomic
    atomic
    Trigger Overview
    CREATE TRIGGER
    Information Schema TRIGGERS Table
    SHOW TRIGGERS
    fill_help_tables.sql
    DROP TRIGGER test.example_trigger;
    DROP TRIGGER IF EXISTS test.example_trigger;
    Query OK, 0 rows affected, 1 warning (0.01 sec)
    
    SHOW WARNINGS;
    +-------+------+------------------------+
    | Level | Code | Message                |
    +-------+------+------------------------+
    | Note  | 1360 | Trigger does not exist |
    +-------+------+------------------------+