Failed to initialize Common Language Runtime (CLR) v2.0.50727 using HRESULT 0x80131522

I get an error

Msg 6512, Level 16, State 27, Line 6 Failed to initialize Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131522. You must restart SQL Server to use the CLR integration features.

I am using SQL Server 2008 R2 Edition with windows 7. This error occurs when creating a stored procedure. inside this stored procedure, I insert some temporary data into a variable table that has only one column with HIERARCHYID as the data type

after some google I find out that this is related to the CLR, so I included clr in sql server

after that, if I check "select * from dm_clr_properties", it means that "CLR initialization has constantly failed"

can anyone help

+4
source share
2 answers

SQLCLR initialization error due to which you cannot perform insertion. The HierarchyID data type uses CLR objects. Have you tried restoring the .NET environment on the machine>

+3
source

You should try running the following in a database that gives you this problem:

select * from sys.assemblies --This is important to check. select * from sys.dm_clr_properties --This is important to check. 

If sys.assemblies returns nothing, then you have a problem.
If "state", from sys.drm_clr_properties, says something other than "CLR initialized," then you have a problem.

You will need to reinstall the .net infrastructure or try to restore it using this tool:
http://www.microsoft.com/en-us/download/details.aspx?id=30135
Note. Our DBA could not complete the repair, because to restart the server it was necessary to restart the server, which is a big problem for our production.

+1
source

All Articles