Computer and Internet » Server » MySQL » Triggers
ID #1008
How can I check to see whether a trigger exists and if it exists then delete it ?
this isn't working
DROP TRIGGER IF EXISTS `trigger_name`
DROP TRIGGER cannot be used together with the handy MYSQL extension "IF
EXISTS". Other 5.0 features, like PROCEDUREs and FUNCTIONs however, do
have this feature.
If you want to test for the existence of a trigger before removing it, you can do the following test before you delete it:
SELECT COUNT(*) FROM information_schema.TRIGGERS where TRIGGER_NAME = {yourtriggerhere};
Tags: -
Related entries:
- Right Character Encoding with CakePHP and Dojo Toolkit
- Dojo Widget Cheat Sheet
- Populate SELECT Tag with Dojo and CakePHP
- Can't update table in stored function/trigger because it is already used by statement which invoked this stored function/trigger
- Does MySQL support after delete or before delete triggers ? If yes , how can I access the row that is deleted or is going to be deleted ?
Last update: 2006-10-20 19:12
Author: Christian Trummer
Revision: 1.1
You cannot comment on this entry