需要适应mysql的脚本

时间:2018-08-28 15:02:11

标签: mysql

USE ActivityLog; 
GO 

SETUSER 'dbo' 
GO 

IF NOT EXISTS (SELECT 1 FROM Events WHERE EventID = 282 AND EV_Event = 'Report Imported') 
BEGIN 
  INSERT INTO dbo.Events 
    (EventID, CategoryID, EV_Event, EV_Template, EV_IsActive, EV_CreationDate) 
  VALUES 
    (282, 6, 'Report Imported', '', 1, GETDATE()) 
END 
GO

我要为mysql编辑上述脚本。

1 个答案:

答案 0 :(得分:1)

我必须删除GO,如果不存在,则GETDATE()也将更改:

插入dbo.Events     (EventID,CategoryID,EV_Event,EV_Template,EV_IsActive,EV_CreationDate,EV_DmlDate,EV_DmlUserID)   价值     (282、6,“已导入对帐报告”,'',1,CURDATE(),CURDATE(),0)

谢谢!