SQL SERVER 2016 error when modifying “User Mapping”.
TITLE: Microsoft SQL Server Management Studio
——————————
Rename failed for User ‘dbo’. (Microsoft.SqlServer.Smo)
For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.37971.0&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+User&LinkId=20476
——————————
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)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.5026&EvtSrc=MSSQLServer&EvtID=15150&LinkId=20476
——————————
BUTTONS:
OK
——————————
Solution:
Log in to SQL SERVER STUDIO with SA and execute the following command.
use testdatabaseName
EXEC sp_changedbowner ‘sa’,’true’