gpt4 book ai didi

sql-server - 尝试删除数据库用户帐户架构时出错

转载 作者:行者123 更新时间:2023-12-02 22:32:27 25 4
gpt4 key购买 nike

我尝试从数据库中删除用户的架构,但收到以下错误:

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 对象是什么?

如何删除引用以便删除旧的用户帐户?

最佳答案

SELECT * FROM sys.objects 
WHERE name = 'getroles'
AND schema_id = SCHEMA_ID('ext_owner');

然后执行:

DROP <object type> ext_owner.getroles;

--或

ALTER SCHEMA <some other schema> TRANSFER ext_owner.getroles;

您可能需要多次重复此操作。您无法删除不为空的架构。

关于sql-server - 尝试删除数据库用户帐户架构时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1929455/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com