Is it possible to run a Job from a stored procedure located in a different server? If so, how?
So why not consider using
exec LINKEDSERVERNAME.msdb.dbo.sp_start_job 'Job Name'
?
(didn't test it though, maybe some-unseen-answer was the same, but erased as incorrect and not working)
There must be enough privileges for linked-server-login to run the job, of course - at least it has to be job's owner.
Yep, you can use the evil that is osql:
osql -S "Remote Server" -E -Q"exec msdb.dbo.sp_start_job 'Job Name'"
(Where -E denotes using a trusted connection, you can also specify credentials using alternative osql syntax)
来源:https://stackoverflow.com/questions/5573227/how-to-run-a-job-from-a-stored-procedure-in-another-server