Possible causes of "Failed to initialize the Common Language Runtime (CLR)" when using SQL CLR

Article translations Article translations
Article ID: 2003681 - View products that this article applies to.
Expand all | Collapse all

Symptoms

When using SQL CLR stored procedures, user defined functions, user defined data types, or user defined aggregates, you many notice one or more of the following error messages being logged in the SQL server error log when running on a 32 bit instance of either SQL Server 2005 or 2008 

Error message 1

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

Error message 2

Msg 6511, Level 16, State 20, Line 1
Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131022.
You may fix the problem and try again later.

Error message 3

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

Error message 4

Msg 6513, Level 16, State 27, Line 1
Failed to initialize the Common Language Runtime (CLR) v2.0.50727 due to memory pressure.
Please restart SQL server in Address Windowing Extensions (AWE) mode to use CLR integration
features.

Error message 5

6513: Failed to initialize the Common Language Runtime (CLR) v2.0.50727 due to memory pressure.
This is probably due to memory pressure in the MemToLeave region of memory.
For more information, see the CLR integration documentation in SQL Server Books Online.

Error message 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.

Additionally, you may see the above error messages with SQL Server 2008 features which use SQL CLR internally, like DMF (Declarative Management Framework) and spatial data types.

Resolution

The error message and HRESULT of the CLR exception can be used to identify the probable cause and likely resolution of the exception

For error messages 1,2,4 and 5 from the above list, the most probable cause of these errors is SQL CLR encountering memory pressure. For further information on how to resolve these errors refer to the following article: 

  • 969962  Various memory errors are logged to SQL Server error log when using SQL CLR objects

For error messages 3 and 6, one probable resolution is to reinstall.NET Framework 2.0. To obtain the .NET Framework 2.0, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en

More Information

References:

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2003681 - Last Review: March 10, 2010 - Revision: 3.0
APPLIES TO
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2005 Evaluation Edition
Keywords: 
KB2003681

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com