Mar 14

Cannot alter user dbo

I was recently faced with the task to alter a SQL user’s database account; more specifically¬†speaking¬† a Login name’s database user name. I ran into this error:

Cannot alter the user dbo. It seems as if SQL server is upset if you attempt to alter the account of the database owner (dbo). To get around this you will need to change the dbo to another account to modify the original user. Use the following code to change the database owner: