The EXECUTE permission was denied on the object

This error is pretty self explanatory. If you are here, I’m sure you simply want to know how to correct it, so here goes.

The user context in which you are executing does not have the rights to execute the procedure or function. So first, in order to find out which user you are, simply execute the following query from the connection that is failing.

[cc lang=”sql”]
SELECT CURRENT_USER
[/cc]

Now that you know this, you need to login as a user that has the rights to change the execute permissions. Though it is not likely this same user that cannot execute the procedure also has the rights to change the permissions, you can still try. Otherwise simply login as a user with ‘dbo’ access and execute this:

[cc lang=”sql”]
GRANT EXECUTE ON [dbo].[procname] TO [youruser]
[/cc]

If you see this error:
Cannot grant, deny, or revoke permissions to sa, dbo, entity owner, information_schema, sys, or yourself. Then you are out of luck. You are using SQL 2005+ and need to login as a different user.

3 comments
Muhammad Waseem 19 Jul 2013 at 12:50 pm

Simple and Quick Solution.
I was trying to find the solution for this problem and everyone is talking so much on this but not presenting a solution like this.

Thanks.

Luis Avila 30 Apr 2013 at 10:15 pm

Excelent solution. It worked fine to me. Thanks a lot.

Waqas Ahmed Hijazi 03 Jan 2012 at 1:42 pm

Hello,

I have searching for an error .i.e “The EXECUTE permission was denied on the object”. But you provide tricky solution, but it has very simple solution. My opinion is to elaborate the problem in simplest way. Like for this problem you can write

1- Go to Security node.
2- Click login node..
so on..

Thanks

Featured Articles

 Site Author

  • Thanks for visiting!
css.php