在 SQL Server 2008 R2 中 - 您可以在数据库图表工具中重命名表吗?

发布于 2024-12-14 15:28:49 字数 151 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

三人与歌 2024-12-21 15:28:49

不,你不能这样做......但是只需单击对象资源管理器中的表,按 F2 并重命名它

Nope you can't do that..however just click on the table in Object explorer, hit F2 and rename it

鸢与 2024-12-21 15:28:49

是的,您可以在图表工具中重命名表格。如果选择该表,则可以在属性窗格中更改该表的名称。如果您没有看到“属性”窗格,只需按 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.

不回头走下去 2024-12-21 15:28:49

可以重命名该表。
我们可以通过以下代码更改现有表的名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文