-2

I have created a stored procedure using SQL Server Management studio.

I am able to create it but if I tryto right click on the stored procedure and execute it, I am getting permission denied error# 229.

I have administrator rights. How can I execute this procedure.

Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
CPDS
  • 597
  • 2
  • 6
  • 18
  • Can you execute it from the script window (`exec sp_YourProcedure`)? [This question on SO](http://stackoverflow.com/questions/2002773/permissions-issue-in-ssms-the-select-permission-was-denied-on-the-object-exten) might be of interest to you. – Lieven Keersmaekers Aug 31 '11 at 06:02

4 Answers4

2

if you are really connecting as sa this should not happen, if you are not, could be that your user does not really have all the rights.

It is also difficult to understand the problem without seeing the body of the stored in case you are doing anything special in there.

at this link anyway: http://www.sqlservercentral.com/Forums/Topic463688-146-1.aspx somebody was discussing the same error and there are some SQL commands scrolling down the page where some people claim to have fixed the issue.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
1

Are you sure that you have sufficient permissions?
Error 229 means that you don't.

Your user needs at least EXECUTE permissions for the stored procedure:
Stored Procedure and Permissions - Is EXECUTE enough?

Here's how you can check if you have the permission:
MS SQL Server: Check to see if a user can execute a stored procedure

Community
  • 1
  • 1
Christian Specht
  • 35,843
  • 15
  • 128
  • 182
0

Verify that you didn't add your user to any of the deny roles, like db_denydatareader.

Andomar
  • 232,371
  • 49
  • 380
  • 404
0

Use this to add execute privillages to your SQL Login:

GRANT EXECUTE ON SPNAME TO UserName;
GO
Cosmin
  • 21,216
  • 5
  • 45
  • 60
Kamsy
  • 1