Cannot use special principal dbo


Error: Cannot use special principal dbo: Error 15405


Today I got a call where user asked that all required roles were not assigned to user database after UAT refresh.

User was having "db_owner" but when I tried to assigning him other roles created for specific purpose we get below error  "Cannot use special principal DBO"

 I tried to give other permissions to user in the User Mapping section of a database. But, I am encountering this error.

On investigating I found:

This is happening because the user is the actual owner of the database  - as such, they can only have db_owner, and cannot be assigned any further database roles. Nor do they need to be. If they're the DB owner, they already have permission to do anything they want to within this database.

 To see the owner of the database, open the properties of the database. The Owner is listed on the general tab. To change the owner of the database, you can use
3. From GUI : goto database properties , and change as below screenshot


Changing owner of database to sa , will allow you to assign any role to your user 

6 comments:

  1. Hi Saurabha,
    Done. but unable to change parameter.

    Regard,
    Dinesh

    ReplyDelete
    Replies
    1. Hi Dinesh

      Are you not able to change owner of database ?? it can be some valid user only. Please try to replace it wit sa.
      If you still face issue , Please mail me error and screen shot @ Saurabh.x.sinha@gmail.com

      Delete
  2. Hello Saurabh,

    your tips above assisted me with setting up my ASPState session db with user sa in cmd.
    I had all the other settings updated in MySql Studio but not the actual db properties /File Owner. Cheers

    ReplyDelete
  3. Fantastic post, right on the dot! Thanks for taking the time to explain the issue.

    ReplyDelete