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编辑上述脚本。
答案 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)
谢谢!