尝试删除数据库用户帐户架构时出错
我试图从数据库中删除用户的架构,但收到以下错误:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Drop failed for Schema 'ext_owner'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+Schema&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot drop schema 'ext_owner' because it is being referenced by object 'getroles'. (Microsoft SQL Server, Error: 3729)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=3729&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
getroles 对象是什么?
如何删除引用以便删除旧用户帐户?
I'm trying to delete a user's schema from a database and I'm getting the following error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Drop failed for Schema 'ext_owner'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+Schema&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot drop schema 'ext_owner' because it is being referenced by object 'getroles'. (Microsoft SQL Server, Error: 3729)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=3729&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
What is the getroles object?
How do I get rid of the reference so I can remove the old user account?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
然后执行:
--或者
您可能需要重复此操作很多次。您无法删除不为空的架构。
Then do:
--or
You will likely have to repeat this a bunch of times. You can't drop a schema that is not empty.
您可以查询系统表
sys.objects
尝试查找有关 getrole 的更多信息。尝试一下
,这应该会给您一些有关该对象是什么的信息。此时,您可以删除它或决定更改架构,以便不再引用它。
You can query the system table
sys.objects
to try to find more information on what getroles might be.Try
This should give you some information on what the object is. At that point you can either drop it or decide to change the schema so that it's no longer being referenced.
尝试使用:
我的猜测是,它是用户在自己的架构下创建的函数或存储过程(可能是无意的。删除它(如果未使用),您应该可以开始了。
Try using:
My guess is that it is a function or stored procedure which that user created under their own schema (possibly accidentally. Drop it (if it's not being used) and you should be good to go.