Orphaned ‘dbo’ User in a SQL Server Database

Login that is the database owner is mapped as 'dbo' database user. If you remove the account that was the owner of the database from the system or if the database owner name is not a valid login in the SQL Server instance where you have attached or restored the database, the database will have no valid owner, and the 'dbo' user will be orphaned from any login.

To find all orphaned users in a database:

USE Database_Name;
EXEC sp_change_users_login 'Report';


If the 'dbo' user is orphaned from any login, the ‘Owner’ field in the ‘Files’ tab in Database ‘Properties’ window will be empty:


Read related articles describing possible problems with databases that don't have a valid owner:
Property Owner is not available for Database ‘[DBName]‘ – error
Database diagram support objects cannot be installed because this database does not have a valid owner – Error

To resolve an orphaned 'dbo' user:

- change the database owner using SQL Server Management Studio, right click on the database, choose ‘Properties’ and on the ‘Files’ tab in the ‘Owner’ field enter the new owner

- or change the database owner by running the following code:

USE Database_Name;
EXEC sp_changedbowner 'Login_Name'



If you try to set the database login to be the database owner, and the login is already mapped to some database user other than 'dbo', you will get an error message:

Msg 15110, Level 16, State 1, Line 1
The proposed new database owner is already a user or aliased in the database.


Or if you use SQL Server Management Studio (SSMS):


To see how to fix other orphaned users in a SQL Server database, read related article:
Fixing orphaned users in a SQL Server database