How to disable "clr strict security" in SQL Server

19,076

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.

Share:
19,076
jakubiszon
Author by

jakubiszon

Updated on June 19, 2022

Comments

  • jakubiszon
    jakubiszon almost 2 years

    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.

  • Solomon Rutzky
    Solomon Rutzky about 4 years
    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.
  • jakubiszon
    jakubiszon about 4 years
    the second one makes the third one possible to run without throwing an exception
  • Solomon Rutzky
    Solomon Rutzky about 4 years
    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.
  • Solomon Rutzky
    Solomon Rutzky about 4 years
    Thanks for removing the non-relevant statements :)
  • Red
    Red over 3 years
    Worked for me on my sql14 instance, but for sql 19+ is no longer necessary
  • coder kemp
    coder kemp about 2 years
    worked for SQL Server 15.0