Cannot find the object “XXX” because it does not exist or you do not have permission

前端 未结 13 1073
[愿得一人]
[愿得一人] 2021-01-11 11:23

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\'

相关标签:
13条回答
  • 2021-01-11 11:51

    If in your stored procedure there are the SET IDENTITY ON & OFF statements, so you need ddl_admin rights added to the user login. This was my solution.

    0 讨论(0)
  • 2021-01-11 11:55

    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.

    0 讨论(0)
  • 2021-01-11 11:56

    As well as other answers about schema/security etc:

    • do you have a DENY on it somewhere?
    • case sensitive object names and using "wrong" name?
    • wrong database context? eg OtherDB.dbo.Myproc
    0 讨论(0)
  • 2021-01-11 11:57

    The scheme may be different. If there is a different scheme, add it in front of it.

    0 讨论(0)
  • 2021-01-11 11:58

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

    I wrote about this very topic recently:

    • Bad habits to kick : avoiding the schema prefix
    0 讨论(0)
  • 2021-01-11 12:00

    I discovered that I had left off the "GO" word after "END" in my stored proc. Altering the Proc and adding back GO fixed this issue for me.

    0 讨论(0)
提交回复
热议问题