Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456

Using xp_cmdshell Expand / Collapse
Author
Message
Posted Monday, April 13, 2009 4:35 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
Did you try the steps that I listed above?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #696219
Posted Tuesday, April 14, 2009 12:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 18, 2013 5:53 AM
Points: 9, Visits: 33

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.


Post #696329
Posted Tuesday, April 14, 2009 1:24 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:25 PM
Points: 9,902, Visits: 9,479
OK Krusna, thanks for the detailed reply, it was very helpful.

Currently, my suspicion is that either the "PDF Printer" settings as user specific and have not been set for whatever user your SQL Server uses for sp_ExecuteSql, or else the default printer has not been set for that user.

I think that you will need to check with the makers of your PDF Printer to see have you can set these from the command line or else how to configure them for another use in advance.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #696947
« Prev Topic | Next Topic »

Add to briefcase «««23456

Permissions Expand / Collapse