How to change the schema for a diagram?
Diagrams created with Microsoft SQL Server Management Studio开发者_如何学JAVA 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?
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.
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.
精彩评论