Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 PRINTING MESSAGES

Author  Topic 

wotrac
Yak Posting Veteran

98 Posts

Posted - 2002-12-08 : 15:45:09
Is there any way to send a message direct to a printer, from within SQl

I am running a stored procedure, as a scheduled job every day. If the procedure is succesful, I would like to inform the user when they get into the office every morning.

The rows inserted during the procedure would be printed out as a message and if there had been any errors these would be reported also.


Does anyone know if this is possible.


Paul



ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-08 : 17:17:56
Write out the results to a file.
http://www.sqlteam.com/item.asp?ItemID=4722

Use xp_cmdshell to execute a print statement of the file.
PRINT [/D:device] [path]

Registring a printer
net use lpt1: \\servername\printer /persistent:yes


Go to Top of Page

wotrac
Yak Posting Veteran

98 Posts

Posted - 2002-12-08 : 17:50:46
Brilliant, just what I was looking for.


Many Thanks

Paul

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-08 : 18:47:19
By the way you could just as easily send an email.

http://www.sqlteam.com/item.asp?ItemID=5003
http://www.sqlteam.com/item.asp?ItemID=5908
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=10447http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=21534http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=13992



Edited by - ValterBorges on 12/08/2002 18:47:31
Go to Top of Page
   

- Advertisement -