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

  • LINQPad puts whatever you write into a MySqlCommand and executes it. I don't see why it shouldn't work if the syntax is vaild.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!