Rename failed for user 'dbo' -MS SQL ERROR 15150

落花浮王杯 提交于 2020-08-16 02:46:01

 

SQL SERVER 2016修改“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
------------------------------

 

解决方法:

以SA登录SQL SERVER STUDIO,执行下面的命令:

use testdatabaseName
EXEC sp_changedbowner 'sa','true'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!