遗留应用程序的SQL Server表和列别名 [英] SQL Server Table and Column Alias for legacy applications

查看:102
本文介绍了遗留应用程序的SQL Server表和列别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚开始为新客户工作时,我注意到他们的数据库架构可能会进行大修。我提出了一些建议(主要是命名约定),这些建议对于我们正在开发的新应用程序套件来说是可以接受的,但是该系统还必须支持所使用的延迟名称(即400左右外部托管的Web应用程序)。

Having just started working for a new client I have noticed that their database schema could do with a serious overhaul. I've made some suggestions (naming conventions mainly) which would be acceptable for the new suite of applications we are developing going forward, however the system would also have to support the lagacy names used (i.e. 400 or so externally hosted web applications).

有什么办法可以执行以下操作:

Is there any way I could do the following:


  • 更改命名在新应用程序中使用的表和列的数量。

  • 创建一个permanenet表别名或类似名称以允许保留滞后代码吗?

远射....

推荐答案

什么人通常在重构重命名表时执行此操作,使用旧表名和结构创建视图,然后对重命名的表进行更改。

What people do usually when refactoring is rename the table, create view with the old table name and structure and then make changes to the renamed table.

例如,如果您从person_id到personid(以强制使用一致的样式),该视图可能引用personid,但将其命名为person_id,这样旧代码就不会损坏。

For instance if you renamed a column from person_id to personid (to enforce a consistent style) the view might reference personid but name it person_id so old code doesn't break.

如果您要重构数据库并保持旧代码运行,我强烈建议阅读
http://www.amazon.com/Refactoring-Databases-Evo lutionary-Database-Design / dp / 0321293533 / ref = sr_1_1?ie = UTF8& s = books& qid = 1254840934& sr = 8-1

If you are going to refactor a database and keep old code running, I highly recommend reading http://www.amazon.com/Refactoring-Databases-Evolutionary-Database-Design/dp/0321293533/ref=sr_1_1?ie=UTF8&s=books&qid=1254840934&sr=8-1

这篇关于遗留应用程序的SQL Server表和列别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆