如何在 SQL Server 中禁用“clr strict security”

jak*_*zon 12 sql-server configuration sqlclr

我通过运行启用了 clr 集成(即 SQLCLR):

EXEC sp_configure 'clr enabled', 1;  
RECONFIGURE;  
Run Code Online (Sandbox Code Playgroud)

现在当我尝试:

EXEC sp_configure 'clr strict security', 0;
RECONFIGURE;
Run Code Online (Sandbox Code Playgroud)

我收到一条错误消息,说该设置不存在:

消息 15123,级别 16,状态 1,过程 sp_configure,第 62 行

配置选项“clr strict security”不存在,或者它可能是一个高级选项。

我知道我的问题的正确解决方案是签署包含存储过程的程序集,以允许它以严格的安全性运行,但现在我需要快速而肮脏的修复。

jak*_*zon 23

启用高级选项解决了我的问题:

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;

EXEC sp_configure 'clr strict security', 0;
RECONFIGURE;
Run Code Online (Sandbox Code Playgroud)

现在我可以创建程序集了。