In this example you get a file c:\brioreports.log with the error code and the date it was run. If run repeatedly it appends lines to the file.CREATE PROCEDURE sp_BrioStatus AS BEGIN If (Select count(*) From brioadmin.briojobs Where Completion_Status <> 'Successful' and Enabled ='Y' and convert(varchar, Last_Date,1)= convert(varchar, (dateadd(dd, 0 ,getDate() )),1) ) >=0 BEGIN RAISERROR ('Failed Brio Jobs', 16 ,1 ) EXEC master..xp_cmdshell 'echo 1 %DATE% >>c:\brioreports.log',no_outputRETURN End EndHTHJasper Smith