【IT168技术文档】
ALTER PROCEDURE [dbo].[sp_dts_addlogentry] @event sysname, @computer nvarchar(128), @operator nvarchar(128), @source nvarchar(1024), @sourceid uniqueidentifier, @executionid uniqueidentifier, @starttime datetime, @endtime datetime, @datacode int, @databytes image, @message nvarchar(2048)AS INSERT INTO sysdtslog90 ( event, computer, operator, source, sourceid, executionid, starttime, endtime, datacode, databytes, message ) VALUES ( @event, @computer, @operator, @source, @sourceid, @executionid, @starttime, @endtime, @datacode, @databytes,@message ) --在包执行结束的时候,查找,如查不存在OnError 事件,说明该包已经执行成功啦 if @event='PackageEnd' begin if not exists(select * from sysdtslog90 where executionid=@executionid and [event]='OnError' ) begin INSERT INTO sysdtslog90 ( event, computer, operator, source, sourceid, executionid, starttime, endtime, datacode, databytes, message ) VALUES ( 'successed', @computer, @operator, @source, @sourceid, @executionid, @starttime, @endtime, @datacode, @databytes,'包处理成功!' ) end end