Wednesday, October 15, 2014

How to write error information into MS SQL Server log?

DECLARE @isExists INT
exec master.dbo.xp_fileexist 'C:\FileName.csv',
@isExists OUTPUT
IF @isExists <> 1
begin
RAISERROR ('Can not find csv file', -- Message text.
16, -- Severity.
1 -- State.
) WITH LOG;
end

No comments:

Post a Comment