Cannot stop an agent job from another agent job?

  • Hi, I can run this job from SSMS no problem: EXEC msdb.dbo.sp_stop_job @Job_name='Main_Job'

    But when I schedule it in an SSIS job I get "The specified @job_name ('Main_Job') does not exist". I am the owner of both jobs, and they are both set to run as the same ID.

    Why does this not work?

    Thanks

  • Mike Aguilar (8/11/2014)


    Hi, I can run this job from SSMS no problem: EXEC msdb.dbo.sp_stop_job @Job_name='Main_Job'

    But when I schedule it in an SSIS job I get "The specified @job_name ('Main_Job') does not exist". I am the owner of both jobs, and they are both set to run as the same ID.

    Why does this not work?

    Thanks

    Could this be a problem with permissions associated with the job scheduler?

    --------------------------------------------------
    ...0.05 points per day since registration... slowly crawl up to 1 pt per day hopefully 😀

  • Try setting the job to 'run as' your id.

  • Thanks sqlsurfing, I'll have the DBA check that.

  • Thanks, I'll try setting to my ID also. Have to wait til the weekend to do it though. I'll post back with what I find.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply