# DROP TRIGGER

## Syntax

```sql
DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
```

## Description

This statement drops a [trigger](https://mariadb.com/docs/server/server-usage/triggers-events/triggers). 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 [SHOW WARNINGS](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-warnings).

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

### Atomic DDL

{% tabs %}
{% tab title="Current" %}
`DROP TRIGGER` is [atomic](https://mariadb.com/docs/server/reference/sql-statements/data-definition/atomic-ddl).
{% endtab %}

{% tab title="< 10.6.1" %}
`DROP TRIGGER` is **not** [atomic](https://mariadb.com/docs/server/reference/sql-statements/data-definition/atomic-ddl).
{% endtab %}
{% endtabs %}

## Examples

```sql
DROP TRIGGER test.example_trigger;
```

Using the IF EXISTS clause:

```sql
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 |
+-------+------+------------------------+
```

## See Also

* [Trigger Overview](https://mariadb.com/docs/server/server-usage/triggers-events/triggers/trigger-overview)
* [CREATE TRIGGER](https://mariadb.com/docs/server/server-usage/triggers-events/triggers/create-trigger)
* [Information Schema TRIGGERS Table](https://mariadb.com/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-triggers-table)
* [SHOW TRIGGERS](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-triggers)
* [SHOW CREATE TRIGGER](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-trigger)
* [Trigger Limitations](https://mariadb.com/docs/server/server-usage/triggers-events/triggers/trigger-limitations)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
