I need to execute a command similar to the following not inside a procedure but inside a simple sql file for mysql 5.xx
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'tr_fnninio_censopersona_ins') THEN
DROP TRIGGER tr_fnninio_censopersona_ins;
END IF;
To destroy the trigger, use a DROP TRIGGER statement. You must specify the schema name if the trigger is not in the default schema: mysql> DROP TRIGGER test.
Remarks. You can remove a DML trigger by dropping it or by dropping the trigger table.
Why not just
DROP TRIGGER IF EXISTS tr_fnninio_censopersona_ins;
MySQL drop trigger doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With