How to disable "clr strict security" in SQL Server
Asked Answered
S

1

25

I enabled clr integration (i.e. SQLCLR) by running:

EXEC sp_configure 'clr enabled', 1;  
RECONFIGURE;  

Now when I try:

EXEC sp_configure 'clr strict security', 0;
RECONFIGURE;

I get an error saying the setting does not exist:

Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62

The configuration option 'clr strict security' does not exist, or it may be an advanced option.

I know the proper solution to my problem is signing the assembly containing the stored procedures to allow it running with strict security but for now I need the quick and dirty fix.

Splayfoot answered 25/2, 2020 at 13:19 Comment(8)
Did you enable the advanced options setting first?Futures
I also assume you aren't using SQL Server on LinuxFutures
What version are you running? This is 2017+ setting.Hydraulic
Yes, it is the latest dev edition "15.02070.41" running on 64bit windows 10 machine.Splayfoot
"15.02070"? The latest version is 15.0.4013.40. We're not even on version 15.1 yet, let alone 15.2070.Futures
I missed the dot, it should be "15.0.2070.41"Splayfoot
Hello jakubiszon. Can you please update the question with the exact error number (i.e. the "Msg XXXX ...") and maybe also the error text? When posting about errors in general, it's always best to include an error message or code given that there are so many different errors. This helps people find the answer to their particular error faster. And in this case, without the error info, you've really just duplicated the official documentation which states that this is an advanced option. Thanks :-)Bushweller
Thanks for adding the error number and message. +1Bushweller
S
58

Enabling advanced options resolved my problem:

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

EXEC sp_configure 'clr strict security', 0;
RECONFIGURE;

Now I can create assemblies.

Splayfoot answered 25/2, 2020 at 13:37 Comment(6)
Hi there. Just FYI: the first 2 statements (i.e. enabling "clr enabled") really has nothing to do with disabling "clr strict security", so should probably be removed. Thanks.Bushweller
the second one makes the third one possible to run without throwing an exceptionSplayfoot
Sorry if I was unclear. I was being a bit literal in that the first two statements are the first EXEC and the first RECONFIGURE.Bushweller
Thanks for removing the non-relevant statements :)Bushweller
Worked for me on my sql14 instance, but for sql 19+ is no longer necessaryTravis
worked for SQL Server 15.0Chloroform

© 2022 - 2025 — McMap. All rights reserved.