当恢复sqlserver bak文件时,原始的用户无法删除的解决方法

前端之家收集整理的这篇文章主要介绍了当恢复sqlserver bak文件时,原始的用户无法删除的解决方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

你无法创建一个相同的用户并mapping这个用户数据库, 并且你无法删除数据库用户:DemoUser.
请运行以下脚本, 之后你就可以删除用户:DemoUser.然后创建用户(DemoUser.)并mapping到数据库
脚本:
<div class="codetitle"><a style="CURSOR: pointer" data="15095" class="copybut" id="copybut15095" onclick="doCopy('code15095')"> 代码如下:

<div class="codebody" id="code15095">
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Membership_BasicAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Membership_FullAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Membership_ReportingAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Profile_BasicAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Profile_FullAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Profile_ReportingAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Roles_BasicAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Roles_FullAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON ROLE::[aspnet_Roles_ReportingAccess] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON SCHEMA::[db_owner] TO [dbo]
GO
GO
ALTER AUTHORIZATION ON SCHEMA::[db_owner] TO [db_owner]
GO

原文链接:https://www.f2er.com/mssql/64133.html

猜你在找的MsSQL相关文章