The EXECUTE permission was denied on the object
-
Posted on June 12, 2010 by Derek Dieter
-
3
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.
- Comments (RSS)
- Trackback
- Permalink
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.
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