0

Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131022. You may fix the problem and try again later.

I get the above error.

Microsoft's Solution

It tells me I have some sort of memory problem pressure but does not provide a solution. I have determined that SQL Server 2008 R2 uses CLR 2 still, so I have tried reinstalling .net Framework 3.5 (which includes .Net Framework 2) but that is not working on my machine which is Windows 10. I have 15.9 GB available of RAM. My SQL Server is Microsoft SQL Server 2008 R2 (SP3) - 10.50.6220.0 (X64).

I am at a loss as to how to solve this problem. I do not think it is a memory issue with. The code that causes the error is pointing to a linked server but it passes the connection test. I should add that I posted a similar question in.StackExchange Database Administrators-How to resolve Geospatial Data over linked server causing error??

Community
  • 1
  • 1
Darren
  • 1,352
  • 5
  • 19
  • 49
  • Are you sure the CLR for SQL is actually installed and activated on that instance of SQL server, independent of all Windows traditional .NET clr stuff. – Sql Surfer Jul 26 '16 at 00:22
  • How do I check if CLR is installed and activated for SQL Server? – Darren Jul 26 '16 at 00:30
  • https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/introduction-to-sql-server-clr-integration – Channa Sep 17 '19 at 18:14

1 Answers1

0

SQL Server: How to check if CLR is enabled? <<-- check out this stack overflow answer

Here is how to change it.

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

I So Rarely activate the CLR surface on SQL Instances due to many application design issues that it brings up. It literally triggers me. (And I don't like triggers).

https://msdn.microsoft.com/en-us/library/ms131048(v=sql.105).aspx

I think you can do this via the SQL Server install setup.

Community
  • 1
  • 1
Sql Surfer
  • 1,344
  • 1
  • 10
  • 25
  • I tried that but I am still getting the same error. I also implemented the following select * from sys.dm_clr_properties and got state 'Locked CLR version with mscoree'. Could that be a problem? – Darren Jul 26 '16 at 00:41
  • Random Ideas: Have you installed SQL Reporting Services? Have you checked the option on Sql Server install that chooses CLR for SQL Server. I would consider a SQL Server setup check first as it does a lot of work dealing with dependencies. – Sql Surfer Jul 26 '16 at 00:45
  • The problem has been isolated to geospatial data coming from a linked server. The linked server works but not for geospatial data. Maybe my .NET framework is corrupted. I do not know. The error is the same. – Darren Jul 26 '16 at 01:32
  • What version is the linked server. The .net runtimes may be different. Also the geospatial stuff was updated in one of the entity frameworks and .net layers significantly for geospatial. When I cross serves I try to use Decimal(8,6) Latitude Decimal(9,6) Longitude at the interface points and not the Geographic or .NET CLR types. Another trick with linked serves is to use the text values for geography like "POINT... (all FYI) – Sql Surfer Jul 26 '16 at 03:04
  • Here is the solution. [How to resolve Geospatial Data over linked server causing error?](http://dba.stackexchange.com/questions/144792/how-to-resolve-geospatial-data-over-linked-server-causing-error/144895#144895). Thanks for your help – Darren Jul 26 '16 at 03:52