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

4

I am getting the error

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

i am using SQL Server 2008 R2 Edition with windows 7. This error occur while creating the stored procedure. inside this stored procedure i am inserting some temp data in a variable table which has only a single column with HIERARCHYID as a the datatype

after some google i come to know that this is something related to CLR so i have enabled the clr in sql server

after that if i check "select * from dm_clr_properties" this says state as "CLR initialization permanently failed"

can anyone please help

sql
asked on Stack Overflow Sep 23, 2011 by user842232

2 Answers

3

SQLCLR initialization failed due to which you are not able to perform the insert. HierarchyID data type uses CLR objects. Have you tried repairing the .NET framework on the machine>

answered on Stack Overflow Sep 23, 2011 by TroubleshootingSQL
1

You should try running the following in the database that is giving you this problem:

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

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

You will need to reinstall the .net framework or try repairing it using this tool:
http://www.microsoft.com/en-us/download/details.aspx?id=30135
Note: Our DBA wasn't able to complete the repair because it required restarting the server which is a big deal for our production envrionment.

answered on Stack Overflow Oct 29, 2012 by MikeTeeVee

User contributions licensed under CC BY-SA 3.0