How do you set a default value for a MySQL Datetime column?
In SQL Server it\'s getdate()
. What is the equivalant for MySQL? I\'m using MySQL 5.x if tha
While defining multi-line triggers one has to change the delimiter as semicolon will be taken by MySQL compiler as end of trigger and generate error. e.g.
DELIMITER //
CREATE TRIGGER `MyTable_UPDATE` BEFORE UPDATE ON `MyTable`
FOR EACH ROW BEGIN
-- Set the udpate date
Set new.UpdateDate = now();
END//
DELIMITER ;