简体   繁体   English

MS SQL Server - 重命名表名但不更改所有查询

[英]MS SQL Server - rename table name but don't change all queries

I need to rename a table.我需要重命名一个表。 There are a lot of different queries.有很多不同的查询。 Is there something like a global table alias?有没有类似全局表别名的东西? I want to have ability to use old queries.我希望能够使用旧查询。 So I expect to use two table's names for the same table.所以我希望对同一个表使用两个表的名称。

你可以使用SYNONYM

CREATE SYNONYM OldTableName FOR DBName.SchemaName.NewTableName;  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM