Account AppUser not able to access SQL Server Agent job “AppSQLAgentJob”

Posted on

Question :

I have added appUser to SQLAgentUserRole and have granted him below permissions

grant execute on dbo.sp_start_job to appuser ;

When I am trying to run AppSQLAgentJob, I am getting following error

“The specified @job_name (‘AppSQLAgentJob’) does not exist.”

Answer :

Could you show us the jobs on your server? Run the query below to check the names and owners:

SELECT name, SUSER_SNAME(owner_sid) AS owner
FROM dbo.sysjobs ORDER BY name -- Or SUSER_SNAME(owner_sid) if you wish

Please note that a member of SQLAgentUserRole can only run a job if the account that owns the job is the account under which the job is started. In other words, the owner of the job can start the job. (Of course a sysadmin can run any job and a member of the SQLAgentOperatorRole can start or stop any job.)

Also see the selected answer at: Allow non-sysadmin, non-owner of a SQL Server Agent job to execute it for other options.

Leave a Reply

Your email address will not be published. Required fields are marked *