如何更改图表的架构?

发布于 2024-09-14 21:17:00 字数 239 浏览 1 评论 0原文

使用 Microsoft SQL Server Management Studio 创建的图表的默认架构设置为 dbo。创建图表时似乎无法设置另一个架构。

对于表,

alter schema NewSchemaName transfer dbo.TableName

将指定的表移动到新架构。但同样的命令不适用于图表。

创建图表后是否可以更改架构?

Diagrams created with Microsoft SQL Server Management Studio have their default schema set to dbo. It seems that there is no way to set another schema when creating a diagram.

For tables,

alter schema NewSchemaName transfer dbo.TableName

moves a specified table to the new schema. But the same command does not work for diagrams.

Is it possible to change the schema once the diagram created?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

清秋悲枫 2024-09-21 21:17:00

尽管图表不附加到架构,但更改所有者将更改 SSMS 中显示的“架构”。

更改 SQL Server 2005 中数据库图表的所有者

如果您想从“dbo”更改为另一个架构,只需确保您的目标架构等于数据库中的有效用户或角色,并更改图表的Principal_ID以匹配该用户或角色的Principal_ID。

Though diagrams are not attached to schemas, changing the owner will change the "schema" displayed in SSMS.

Change Owner of Database Diagram in SQL Server 2005

As you want to change from "dbo" to another schema, just make sure your destination schema equates to a valid user or role in the database and change the diagram's Principal_ID to match that user's or role's Principal_ID.

不必了 2024-09-21 21:17:00

不。

图表没有模式,因为它们不是 sys.objects 中的行/对象。

它们拥有所有者,但不是在架构/用户分离意义上。

No.

Diagrams do not have schemas because they aren't rows/objects in sys.objects.

They have owners but not in the schema/user separation sense.

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