Cannot find the object because it does not exist or you do not have permissions. Error in SQL Server

前端 未结 14 2114
面向向阳花
面向向阳花 2020-12-05 12:35

I have a database and have a Sql script to add some fields to a table called \"Products\" in the database.

But when i am executing this script, I am getting the foll

14条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 13:20

    I've been trying to copy a table from PROD to DEV but get an error: "Cannot find the object X because it does not exist or you do not have permissions."

    However, the table did exist, and I was running as sa so I did have permissions.

    The problem was actually with CONTRAINTS. I'd renamed the table on DEV to be old_XXX months ago. But when I tried to copy the original one over from PROD, the Defaut Constraint names clashed.

    The error message was misleading

提交回复
热议问题