question

Bugmesh avatar image
Bugmesh asked

Calling the Windows Task Scheduler from SQL Server

I have a print process that runs on a separate server from our database server and it is controlled by the Windows Task Scheduler. Currently, the SQL Job runs on the database server and queues up the print file, then at 7:00 AM a Windows Task runs on the print server and prints all files in the print queue. I would like to call that Windows task from the SQL job. The idea is to print files as the job finishes instead of queueing up multiple files. The SQL job runs on a SQL Server 2000. Is there a way to call the Task Scheduler on the print server? Any help would be appreciated.
sql serverscheduletask
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
From within SQL Server 2000, your only real option is a command line call. You could do that from SQL Agent very easily or, not a good option in any way because it requires serious security exposure, you could look to xp_cmdshell. I don't recommend that. You'd be much better off using SQL Agent.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.