在 SQL Server 2008 R2 中 - 您可以在数据库图表工具中重命名表吗?
我正在使用 SQL Server 2008 R2 版本的数据库图表工具。尽管我可能进行搜索,但我似乎找不到在用户界面中重命名表的方法。这真的不可能吗?重命名列很容易,但我能够“重命名”表的唯一方法是使用新名称重新创建它,建立适当的外键关系,然后删除旧表。
谢谢, 西尔维娅
I'm using the SQL Server 2008 R2 version of the Database diagram tool. Search as I might, I can't seem to find a way to rename tables in the UI. Is this really not possible? Renaming a column is easy, but the only way I've been able to "rename" a tables is to recreate it with the new name, make the appropriate foreign key relationships, and then delete the old table.
thanks,
Sylvia
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,你不能这样做......但是只需单击对象资源管理器中的表,按 F2 并重命名它
Nope you can't do that..however just click on the table in Object explorer, hit F2 and rename it
是的,您可以在图表工具中重命名表格。如果选择该表,则可以在属性窗格中更改该表的名称。如果您没有看到“属性”窗格,只需按 F4,它就会自动显示在 Studio Manager 的右侧。
属性的顶部部分是(身份),名称是第一个属性。只需更改 Name 属性的值并保存即可。
Yes, you can rename table in the Diagram tool. If you select the table, you can change the table's name in the Properties pane. If you do not see the Properties pane, simply press F4 and it should automatically appear on the right side of the Studio Manager.
The top section of Properties is (Identity) and Name is the first property. Simply change the value of the Name property and save.
可以重命名该表。
我们可以通过以下代码更改现有表的名称。
EXECUTE sp_rename 'oldTableName' , 'newTableName'
EXECUTE sp_rename 'tb1' , 'tb2'
确实有效,尝试一下。
It is possible to rename the table.
We can change the name of existed table by following code.
EXECUTE sp_rename 'oldTableName' , 'newTableName'
EXECUTE sp_rename 'tb1' , 'tb2'
It really work try it.