Cannot find the object “XXX” because it does not e

2019-06-15 14:26发布

I'm getting the following error when calling a stored procedure:

Cannot find the object "XXX" because it does not exist or you do not have permission.

I've checked the database and the SP is there with the correct permissions yet I'm still getting the error.

Any suggestions?

10条回答
迷人小祖宗
2楼-- · 2019-06-15 14:56

Always use the dbo. (or other schema) prefix both when creating and when accessing objects.

I wrote about this very topic recently:

查看更多
地球回转人心会变
3楼-- · 2019-06-15 15:03

The account that you are using when calling the stored procedure must not be the same account that you are using to check it. Make sure that the account that you are using to execute the sproc has access to the object.

查看更多
干净又极端
4楼-- · 2019-06-15 15:05

Using the 'GO' fixed the issue for me as well. This was driving me crazy, after multiple drops and checking permissions for users and schema, this is what finally helped.

查看更多
贼婆χ
5楼-- · 2019-06-15 15:06

I meet this issue too. In my case, I granted execution permission just after creating stored procedure. And there is no 'GO' between the two statements. I added GO, and it works.

查看更多
登录 后发表回答