This question shows research effort; it is useful and clear
21
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我需要在 mysql 5.xx 的简单 sql 文件中而不是在过程中执行类似于以下的命令
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'tr_fnninio_censopersona_ins') THEN
DROP TRIGGER tr_fnninio_censopersona_ins;
END IF;
DROP TRIGGER IF EXISTS tr_fnninio_censopersona_ins;
DELIMITER $$
CREATE TRIGGER tr_fnninio_censopersona_ins
BEFORE INSERT ON `your_table` FOR EACH ROW
BEGIN
SET NEW.INSERTED= NOW();
END$$
DELIMITER ;