Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TRIGGER OUTPUT

Status
Not open for further replies.

jrc1

IS-IT--Management
Apr 17, 2001
24
US

I am trying to create a trigger(SQL Server 7) that will send output to a printer. The problem I am having is I cannot figure out what command to send the output to the printer. What command should be used to send output to a printer in a trigger?

Jeff
jchie@vafb.com
 
well... if you can do it in DOS, then you can do it by calling xp_cmdshell ( as type filename > LTP1: or whatever) .

You can also create an active-x component, instantiate it sp_oacreate), and call some methods (sp_oamethod) to accomplish your needs as well..

However, as foxdev (TIPMASTER OF THE WEEK) stated, you cannot directly access the printer.

You can also store the results and print them off from another job at a later time... Tom Davis
tdavis@sark.com
 
Following up on Tom's idea, you could have a log table where the output is placed, then use the client tool of your choice to print it once a day or whenever. You would also eliminate any possible headaches with the trigger failing because of some external I/O problem.
Robert Bradley
 
I think from DOS you can try PRINT (file_name) command to print from command prompt (cmd)
Not quite sure how it works. Just a try is a worthwile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top