SQL – The EXECUTE permission was denied on Stored Procedure

The EXECUTE permission was denied on the object ‘STORED_PROC’, database ‘MYDB’, schema ‘dbo’

This massage is received when the SQL Server account under which you make the request doesn’t have permission to execute the stored procedure. you can overcome this problem by modifying the permissions of the SP.
If you want to grant public access, so all users can execute the procedure:

USE [DATABASE];
GRANT EXEC ON dbo.[MYSTOREDPROCEDURE] TO PUBLIC

 

If you want to tighten security to allow only specific users to execute the SP, which is advisable, then its:

USE [DATABASE];
GRANT EXEC ON dbo.[MYSTOREDPROCEDURE] TO MYUSER

OR

USE [DATABASE];
GRANT EXEC ON dbo.[MYSTOREDPROCEDURE] TO MYGROUP

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s