Tags

, , , ,


One of the junior DBA of my previous organisation recently asked me about this error which he was receiving while changing the database owner of one database in QA environment. The error is pretty much self-explanatory. But I thought I should write about it which may help some DBAs.

Below is the exact error:

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

The reason for this error is- the user which we are trying to make the owner of the database, is already a user for the same database. The fix for this error is pretty simple. For the demo, I have a database called MyDB and let’s try to change the database owner of the database MyDB to ‘test_user’

USE MyDB
GO
SP_CHANGEDBOWNER ‘test_user’

And we are getting the error:

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

To fix the same, lets take the following steps:

USE MyDB
GO
SP_DROPUSER ‘test_user’ — Dropping test_user from the user database
GO
SP_CHANGEDBOWNER ‘test_user’ — Changing the OWNER of the database

Hope this helps.

Cheers,

Subhro Saha

 

Advertisements