When I attempt to change the default schema of the dbo in SQL Server Management Studio, the ALTER fails and states that the dbo account's schema cannot be changed. Are there any tricks that can make is possible to change the the dbo default schema of "dbo" to "xxx"?
Thank you!
Best Answer
Each database is owned by a server principal (aka login). Inside that database, the owning principal is known as
dbo
(aka *D*ata*B*ase *O*wner). The database principal (aka user) loses its real name.For example, for a database I own:
Will print "dbo", "Andomar". If you'd change the owner to
sa
:The query would return "dbo", "sa".
You cannot modify the default schema for the user that owns a database. It is always user name
dbo
with default schema namedbo
.