Click here to Skip to main content
15,881,709 members
Articles / Programming Languages / SQL

The EXECUTE Permission was Denied on the Object ‘sp_start_job’, database ‘msdb’, schema ‘dbo’

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
19 Feb 2013CPOL 55.8K   1   1
EXECUTE permission was denied on the Object ‘sp_start_job’, database ‘msdb’, schema ‘dbo’

Issue

Today, I have read one issue over one forum, one user is having below 3 DB roles on MSDB but whenever user tries to run SQL Agent job, it gets the below error message.

We have checked that SQL Agent job related DB role is properly given to user. Also, Job is working fine by the use is having sysadmin roles.

  • SQLAgentUserRole
  • SQLAgentReaderRole
  • SQLAgentOperatorRole

Image 1

Resolution

We have found that someone has denied the execute permissions from SQLAgentUserRole over sp_start_job stored procedure in MSDB.

We have run the below query to check the permissions over sp_start_job stored procedure in MSDB.

SQL
USE MSDB
GO
SELECT PR.NAME, DP.PERMISSION_NAME, DP.STATE_DESC
FROM MSDB.SYS.DATABASE_PERMISSIONS DP
JOIN MSDB.SYS.OBJECTS O ON DP.MAJOR_ID = O.OBJECT_ID
JOIN MSDB.SYS.DATABASE_PRINCIPALS PR
ON DP.GRANTEE_PRINCIPAL_ID = PR.PRINCIPAL_ID
WHERE O.NAME = ‘SP_START_JOB’

I have found that someone has denied the execute permissions from SQLAgentUserRole over sp_start_job stored procedure in MSDB.

Image 2

By running the below query, execute permission has been given back & issue has been resolved.

SQL
USE MSDB
GO
GRANT EXECUTE ON SP_START_JOB TO SQLAGENTUSERROLE

Reference

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionI granted permission but still have the same error Pin
Mbulungo12-Dec-14 1:51
Mbulungo12-Dec-14 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.