DROP TRIGGER IF EXISTS

edited May 2012
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$
-- (re)-creating the "before insert" trigger
DROP TRIGGER IF ' at line 1

-- Is the following supported in LinqPad using MYSQL?

-- (re)-creating the "before update" trigger
DROP TRIGGER IF EXISTS `trigger_code_before_update` $$
CREATE TRIGGER `trigger_code_before_update` BEFORE UPDATE ON `code`
FOR EACH ROW BEGIN
SET NEW.`modified` = CURRENT_TIMESTAMP();
SET NEW.`created` = OLD.`created`;
END;
$$

Thanks in advance,
Gregg M

Comments

Sign In or Register to comment.