开发者

MSSQL schema problem - I renamed a table , now the database is referencing the old name

here is my problem how to fix the schema of a renamed table manually.

开发者_运维知识库

I have a table called ActiveCustomers I renamed it to ActiveCustomersOld I then renamed it again ActiveCustomers ( to its original name)

Select * from ActiveCustomers it does work. But if I rename the table to ActiveCustomerOld select * from ActiveCustomers works.

Why? Because SQL schema it mapping it to ActiveCustomerOld table to the name ActiveCustomers.

How do I change the schema of a table to mapp to certain keywords. For example Select * from A should map to a table called c


You could consider using a SYNONYM if you are using SQL Server 2005 or greater (it's always a good idea to specify the version you are using). You should also ALWAYS use the schema prefix when creating or referencing entities.


you can use synonyms to achieve that, though i don't know if you can mask actual entities that way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜