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
 General SQL Server Forums
 New to SQL Server Programming
 Execute a job from DOS

Author  Topic 

Ernie57
Starting Member

27 Posts

Posted - 2006-06-10 : 18:42:16
I want to start of run a job from DOS. I have MS SQL 2000 using Enterprise Manager.

Thank You,

Ernie

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-10 : 19:26:23
You can use osql to run sp_start_job.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Ernie57
Starting Member

27 Posts

Posted - 2006-06-10 : 23:14:42
quote:
Originally posted by nr

You can use osql to run sp_start_job.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.



What's the command line to run it? I tried osql at the command prompt, but nothing happened!

Thank You,

Ernie
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-11 : 10:41:06
Have a look in bol.
something like

osql -E -Smyserver -Q"exec sp_start_job 'jobname'"

You will need to have osql.exe on the machine. It's installed with the client utilities or you can just copy it.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -