• 1) Modify your PrintToPDFConsole.exe to always return to the console a detailed status description. If it failed, then it should return the error number, error message, line number, etc. AND if it succeeds (or thinks that it has), it should also say that: what it printed and to where. This is crucial to debugging any problems, because right now for instance you are getting nothing back and thus have no idea where the problem might be.

    Yes, Now the exe got changed. I've added the message 'Printing Done' after the process start. And it can't say where the printing has done. Because the setting is there in the PDF Printer, not in the code.

    2) Logon the the server's console (Workstation or Remote Desktop), open a DOS window and execute your PrintToPDFConsole command there. Debug any problems.

    Here there is no problem. The message comes 'Printing Done'. Also, the printing process finishes. When the process is going on, I can see the operations and in the status bar, Printer logo and adobe pdf logo also there.

    3) Next, still from a console logon, use SSMS (Management Studio) to connect to SQL Server, and from a query window run your sp_ExecuteSql command. Debug and/or report any problems back to us.

    This gives the following output

    Printing Done

    NULL

    But there is no printing process also no logo on the status bar.

    And in the adobe pdf printer, the status is 'spooling' and this status remains till it has not been canceled.

    and the owner is 'SYSTEM' here.

    4) Now, still from the console, run your stored procedure and debug and/or report any problems back to us.

    This gives result same as option 3.

    5) Now open a query window from desktop and execute the sp_ExecuteSql command again. Debug and/or report any problems back to us.

    This gives result same as option 3.

    6) Finally run your stored procedure as you intend it to run. Debug and/or report any problems back to us.

    This gives result same as option 3.