• One bug that is still in the statement is that you have to cast @ID to string in the concatenation for @TaskOutFile.

    Select @TaskOutFile = 'C:\SSIS' + CONVERT(VARCHAR(10),@ID) + '.html';

    The errors are about another stored procedure by the way.

    I can't test the code myself, because I don't have SQL Server editions that old.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP