Check database owner by the below sql query:
select name, SUSER_SNAME(owner_sid) OWNER from sys.databases;
To change the owner of a database, the following either way should do the job.
- On SQL Server Management Studio -> Right Click on Database -> Properties-> Files ->click Owner..
2. Change owner of a database by sql.
ALTER AUTHORIZATION ON DATABASE::TESTDB TO "VIRTUALLAB\Administrator";
If you meet the following error messages.
Msg 15110, Level 16, State 1, Line 48 The proposed new database owner is already a user or aliased in the database.
Then drop the user first, and re-run the above one.
USE "TESTDADB"; GO drop user "VIRTUALLAB\Administrator"; ALTER AUTHORIZATION ON DATABASE::TESTDB TO "VIRTUALLAB\Administrator";