我意味着为 SQL Server 登录名分配
db_datareader
db_datawriter
数据库角色。但如果一时肚子疼、累了,我就会不小心把它们的架构所有权交给该用户:
暂时忽略它在概念上意思是用户“自己的”这两个内置模式。暂时忽略它是否是问题如果用户拥有这两个模式(例如,如果我想删除用户,内置模式是否会随之删除)。
我的问题是:我该如何撤消它?
将 SCHEMA::[db_datareader] 上的授权更改为 [db_datareader]F5
但这并没有任何作用;所以现在是时候咨询专家了。
Microsoft SQL Server 2005 - 9.00.5057.00 (Intel X86) 2011 年 3 月 25 日 13:50:04 版权所有 (c) 1988-2005 Microsoft Corporation 标准版
答案1
alter authorization on schema::[db_datareader] to [dbo]
alter authorization on schema::[db_datareader] to [db_datareader]
alter authorization on schema::[db_datawriter] to [dbo]
alter authorization on schema::[db_datawriter] to [db_datawriter]
答案2
执行以下操作将使您的工作变得简单:以 SA 帐户打开 SQL Server,单击创建新查询和过去的吹嘘查询,然后单击执行!完成。
alter authorization on schema::[db_datareader] to [dbo]
alter authorization on schema::[db_datareader] to [db_datareader]
alter authorization on schema::[db_datawriter] to [dbo]
alter authorization on schema::[db_datawriter] to [db_datawriter]
alter authorization on schema::[db_securityadmin] to [dbo]
alter authorization on schema::[db_securityadmin] to [db_securityadmin]
alter authorization on schema::[db_accessadmin] to [dbo]
alter authorization on schema::[db_accessadmin] to [db_accessadmin]
alter authorization on schema::[db_backupoperator] to [dbo]
alter authorization on schema::[db_backupoperator] to [db_backupoperator]
alter authorization on schema::[db_ddladmin] to [dbo]
alter authorization on schema::[db_ddladmin] to [db_ddladmin]
alter authorization on schema::[db_owner] to [dbo]
alter authorization on schema::[db_owner] to [db_owner]