Search

Monday, July 8, 2013

Cannot alter the user 'dbo'. (Microsoft SQL Server, Error: 15150)

Some times we may get the below error while updating the login from dbo to some other login from user mapping window.

1. I have database which is mapped with dbo login and dbo schema. 
2. I tried to update the database with app_user login, then it displays below error:


Cannot alter the user 'dbo'. (Microsoft SQL Server, Error: 15150)

To fix this issue we need to change the default owner to 'sa' and then tried to update the login. 

Use database_name
sp_changedbowner 'sa'

19 comments:

  1. Thank you, thank you, thank you!!!

    ReplyDelete
  2. Thank you very much! I needed to type EXEC at the beginning of the second line.

    ReplyDelete
  3. What about if the 'sa' is disabled and you do not want to have any 'dbo' owning the db?

    ReplyDelete
    Replies
    1. I have sa disabled, I assigned sa like owner and then change it again to my service account and it works

      Delete
  4. Thank you, thank you, thank you!!!!!!

    ReplyDelete
  5. Thank You .. It works!!!!

    ReplyDelete