SQL Server, cannot alter the user 'dbo', 如何解决SQL Server不能更改dbo问题

来源:互联网 发布:python 斜杠 替换 编辑:程序博客网 时间:2024/05/27 20:14
Some times we may get the below error while updating the login from dbo to some other login from user mapping window.

1. I have database which is mapped with dbo login and dbo schema.
2. I tried to update the database with app_user login, then it displays that error message.

To fix the issue we need to change the default owner to 'sa' and then tried to update the login.

Use database_name
sp_changedbowner 'sa'

It may cause because dbo is mapped with some other login, then we need to change the dbo login name to 'sa', it is because the sa login is reffered as dbo and it will exists in all the databases. So we should not modify the dbo login to any other login except 'sa'.


如果dbo map到非sa的login时,在更改dbo时,会遇到一些错误,解决办法是把数据库的默认owner更改为sa,然后在编辑dbo。

Use database_name
sp_changedbowner 'sa'


转自: http://calyansql.blogspot.com/2012/07/cannot-alter-user-dbo-microsoft-sql.html


0 0