gpt4 book ai didi

sql-server-2005 - 在 SQL : MSG 33009 中创建程序集时出错

转载 作者:行者123 更新时间:2023-12-01 01:38:10 24 4
gpt4 key购买 nike

我正在尝试使用以下命令将 dll 加载到 MSSQL 中:

USE dbname
GO

CREATE ASSEMBLY foo
FROM 'C:\foo\foo.dll'
WITH PERMISSION_SET = UNSAFE
GO

我收到一个错误,指出:
Msg 33009, Level 16, State 2, Line 2The database owner SID recorded in the master database differs from the database owner SID recorded in database 'dbname'. You should correct this situation by resetting the owner of database 'dbname' using the ALTER AUTHORIZATION statement.

MSDN really isn't telling me any more about the error than the error tells itself.

I've looked all over the internet and have come to the conclusion that only thing anyone has ever done to avoid this is to:

use dbname
go
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false

但是改变所有者真的是避免这个错误的唯一方法吗?为什么我必须这样做,还有其他方法吗?在我进入并盲目更改所有者之前,我想了解有关此错误的更多信息。

最佳答案

我遇到了完全相同的问题,对我来说唯一的解决方案是更改所有者,然后再将其更改回来。

问题是用户既是每个数据库又是每个服务器。发生的情况是每个数据库用户的用户名与每个服务器用户的用户名相同,但是它们的 SID 不匹配,因此它认为它可能是不同的人。

关于sql-server-2005 - 在 SQL : MSG 33009 中创建程序集时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/497128/

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