• When you go to DOS you execute the command in your desktop/laptop environment, and "C:\Temp\OrderNo_123.xml" is a file on your computer with your user having administrative permission over it.

    When launch it from SQL Server you execute it in the server environment, and "C:\Temp\OrderNo_123.xml" would be a file on the server, and you're trying to access it using the privileges given to the account which runs that particular SQL Server instance (check Windows Services).

    Make sure it's all in order over there.

    _____________
    Code for TallyGenerator