I have written a small VB application which prints a packing list for a specified key value. The syntax for the application is:
Packing List.exe nnnn
where nnnn is the ID of the packing list to be generated.
My intent is for client machines to be able to automatically print packing lists when products are shipped. I first created a command file called PACKLIST.CMD with the following contents:
"Packing List" %1
Finally, I have placed the following code into the Update trigger of the associated table:
execute master..xp_cmdshell "packlist nnnn"
When I execute the above command in ISQL/w, the following is returned:
C:\WINNT>"Packing List" 3001
(8 row(s) affected)
This seems to indicate that the command is running successfully. However, no packing lists are printing, regardless of whether I execute the command from a client or from the server.
My question is this: Is it possible to run a program located on a SQL server from a client machine that sends output to a printer? When I try something simpler, such as "execute master..cmdshell 'dir *.exe'" everything seems to work properly, but running other executables doesn't work. In books Online there is an example that runs NET SEND and then pauses and later pauses the SQL server, so I thought that I should be able to execute *any* executable on the server using xp_cmdshell.
If xp_cmdshell won't do what I want it to, then how can I accomplish this task, if at all?
Thank you in advance for your assistance. Please send any responses to firstname.lastname@example.org.
Engineering Animation Inc.
V · 515.296.7056 F · 515.296.7025
M · email@example.com W · http://www.eai.com