cam
cam

Reputation: 113

SQL - Modify or Delete a Trigger

I created triggers, and I can see them when I do SHOW TRIGGERS. How is it possible to either modify or delete them?

I use MySQL

Upvotes: 2

Views: 171

Answers (3)

Santosh Chaurasia
Santosh Chaurasia

Reputation: 113

create or replace trigger <trigger_name>

using above statement you can modify the trigger .

Upvotes: 1

Sashi Kant
Sashi Kant

Reputation: 13465

You cannot alter a trigger, while you have to drop it and then create the new one. The drop syntax is

DROP TRIGGER trigger_name

Upvotes: 1

juergen d
juergen d

Reputation: 204854

delete trigger:

drop trigger trigger_name

modify trigger:

drop trigger trigger_name
create trigger trigger_name ...

There is currently no alter trigger at the moment. SO you have to drop and recreate a trigger if you want to modify it.

TRIGGER SYNTAX

Upvotes: 0

Related Questions