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'

5 comments:

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

    ReplyDelete
  2. Thank you a lot.

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

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

    ReplyDelete
  5. Thank you, thank you, thank you!!!!!!

    ReplyDelete