Home Forums Programming Connecting Run SQL Server Job from Command Line RE: Run SQL Server Job from Command Line

  • use either osql or sqlcmd, depending on your version of SQL (2000 uses osql, 2005 is sqlcmd)

    you can use that to run sp_startjob

    so your command may look like this:

    osql -E -SserverName -q"sp_start_job @job_name = 'job_name', @server_name = 'server_name'"