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条答案
按热度按时间wvt8vs2t1#
我不得不删除go,如果不存在,getdate()也会更改:
插入dbo.events(eventid,categoryid,ev\u event,ev\u template,ev\u isactive,ev\u creationdate,ev\u dmldate,ev\u dmluserid)值(282,6,'已导入对帐报告','',1,curdate(),curdate(),0)
谢谢!