Hi Vince Husenajr
It seems like you're encountering a common issue when trying to change the schema owner from 'dbo' to another user in SQL Server. The error message "Msg 15150 – Cannot Alter The User ‘dbo’" indicates that the operation you're attempting is not allowed directly through the SSMS interface.
To resolve this issue, you can follow these steps:
Change the Database Owner to 'sa':
- One effective workaround is to change the database owner to 'sa' (the system administrator account). This can be done using the following T-SQL command:
USE [dbname] EXEC sp_changedbowner 'sa' GO
- This command changes the database owner to 'sa', which should allow you to modify the user mappings as needed Verify the Change:
- After executing the command, verify that the database owner has been changed by checking the properties of the database in SSMS.
Reassign Ownership:- If you need to assign the ownership to a different user, you can now do so without encountering the error. Use the following command to change the owner to your desired user:
SQL SERVER – FIX: Msg 15150 – Cannot Alter The User ‘dbo’:USE [dbname] EXEC sp_changedbowner 'new-dbuser' GO
- This blog post provides a detailed explanation of the error and suggests changing the default owner to 'sa' as a solution
https://blog.sqlauthority.com/2017/12/12/sql-server-fix-msg-15150-cannot-alter-user-dbo/ - After executing the command, verify that the database owner has been changed by checking the properties of the database in SSMS.