Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

SHOW CREATE TRIGGER In MySQL 5.0

DZone's Guide to

SHOW CREATE TRIGGER In MySQL 5.0

·
Free Resource
MySQL 5.0 lacks "SHOW CREATE TRIGGER". Here's a VIEW to list all triggers and (a close approximation of) their CREATE statements.


CREATE VIEW `SHOW_CREATE_TRIGGERS` AS
  SELECT
    TRIGGER_NAME AS 'trigger_name'
    ,CONCAT_WS(
      " ",
      "DELIMITER $$\nCREATE TRIGGER",
      TRIGGER_NAME,
      ACTION_TIMING,
      EVENT_MANIPULATION,
      "ON",
      EVENT_OBJECT_TABLE,
      "FOR EACH ROW",
      ACTION_STATEMENT,
      "$$\nDELIMITER ;"
    ) AS 'sql'
  FROM information_schema.triggers;
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}