Mysql(Mariadb)之删除触发器DROP TRIGGER分析(英文)

China☆狼群 提交于 2020-03-07 03:46:58

DROP TRIGGER

Syntax

DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name

Contents

  1. Syntax
  2. Description
  3. Examples
  4. See Also

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 SHOW WARNINGS.

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

Examples

DROP TRIGGER test.example_trigger;

Using the IF EXISTS clause:

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

原文地址:https://mariadb.com/kb/en/drop-trigger/


欢迎加我们微信wang1415035017进入微信高级技术群共同进步,或者扫码加入我们哦(V_V) 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!