Enabling CLR still prevents me from running code on sql server

I use the following command to try to enable the CLR in an instance of SQL Server 2008

EXEC sp_configure 'clr enabled', 1 GO RECONFIGURE GO 

But I still get the following error

.NET Framework code execution is disabled. Install the "clr enabled" configuration and restart the server

Do I need to do anything?

+5
source share
3 answers

To verify what has been verified and undertaken so far:

  • EXEC sp_configure 'clr enabled', 1; done. Completed
  • RECONFIGURE; .
  • The server is rebooted. This should be necessary on WOW64 servers.
  • Running EXEC sp_configure 'clr enabled'; shows a 1 for run_value .
  • Running EXEC sp_configure 'lightweight pooling'; shows 0 for run_value .
  • state property in sys.dm_clr_properties has the value "Closed version of the CLR with mscoree", which means:

    A closed version of the CLR with the mscoree state can be seen where the hosted CLR is not in use and thus has not yet been initialized. The CLR host is initialized the first time a DDL statement is executed (for example, CREATE ASSEMBLY (Transact-SQL) ) or a database managed object.

Additional things to check / check:

  • Make sure the .NET Framework 2.0 and 3.5 SP1 are installed
  • Verify that .NET Framework patches have been applied through Windows Update
  • The Control Panel \ Programs \ Programs and Features may have been set to "CLR Types for Microsoft SQL Server"
  • Check authentication type. If set to both, try switching to Windows Only, restart the SQL Server service and see if that helps. Not a good long-term solution, but may indicate a direction.
  • What account does the MSSQLSERVER service register? There are some reports that the Network Service or NT AUTHORITY \ Network Service may have problems and that the Local System account may be preferable.
  • ??
+3
source

Try

 EXEC sp_configure 'clr enabled', 1 go RECONFIGURE go EXEC sp_configure 'clr enabled' go 

Besides

To enable CLR integration, you must have ALTER SETTINGS server level permission, which is implicitly held by members of the sysadmin and serveradmin fixed server roles.

0
source

Do you have advanced options?

 sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'clr enabled', 1; GO RECONFIGURE; GO 
0
source

Source: https://habr.com/ru/post/1242091/


All Articles