SQL SERVER – FIX: Msg 15150 – Cannot Alter The User ‘dbo’.

SQL
10 Comments

One of my clients was deploying SharePoint and they were following some documents to make sure it is as per their standard deployment. They were seeing below error while updating the login from dbo to some other login from user mapping window (for login properties window). Let us learn how to fix error 15150 about cannot alter the user.

Rename failed for User ‘dbo’. (Microsoft.SqlServer.Smo)
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
——————————
Cannot alter the user ‘dbo’. (Microsoft SQL Server, Error: 15150)

SQL SERVER - FIX: Msg 15150 - Cannot Alter The User 'dbo'. dbo-rename-err-01.-800x731

When I ran on script option, here was the output

USE [DBODB]
GO
ALTER USER [dbo] WITH NAME=[DB1]
GO

WORKAROUND/SOLUTION

To fix this issue we need to change the default owner to ‘sa’

Use <database_name>
GO
sp_changedbowner 'sa'
GO

Well, this looks very simple but indeed a very crucial blog. I see this error every single day with my customer and today I decided to write a blog post about it.

There are a few other blogs related to this blog post are listed here:

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Error Messages, , SQL Scripts, SQL Server, SQL Server Security
Previous Post
SQL SERVER – Msg 3225: Use of WITH CREDENTIAL Syntax is Not Valid for Credentials Containing a Shared Access Signature
Next Post
SQL SERVER – FIX: SQL Service Does Not Start After Promoting the Machine as Domain Controller

Related Posts

10 Comments. Leave new

Leave a Reply