What's new in CLR integration?

Applies to: SQL Server

The following are new features in .NET Framework common language runtime (CLR) integration in SQL Server 2012 (11.x) and later versions:

  • In version 4 of the CLR, CLR database objects no longer catch corrupted state exceptions. These exceptions are now caught in the CLR integration hosting layer. CLR database components can still catch these exceptions by setting a code attribute (<legacyCorruptedStateExceptionsPolicy> Element). However, this attribute isn't recommended, because results aren't reliable when a corrupted state exception occurs.

  • Due to strict security requirements in SQL Server, CLR database components continue to use the Code Access Security model defined in CLR version 2.0.

  • In CLR version 4, a format error in a System.TimeSpan value generates a System.FormatException error. Before version 4 of the CLR, a format error in a System.TimeSpan value was ignored. Database applications that rely on the behavior before version 4 of the CLR should run with a database compatibility level of 100 or lower. For more information, see <TimeSpan_LegacyFormatMode> Element.

  • CLR version 4 supports Unicode 5.1. Sort operations involving some accent marks and symbols are improved. Compatibility problems might occur if your application relies on legacy sorting behavior. To enable legacy sorting, the database compatibility level must be set to 100 or lower. To support this functionality, SQL Server 2012 (11.x) installs sort00001000.dll in the .NET Framework 4 directory (C:\Windows\Microsoft.NET\Framework\v4.0.30319). For more information, see <CompatSortNLSVersion> Element.

  • The following columns were added to sys.dm_clr_appdomains: total_processor_time_ms, total_allocated_memory_kb, and survived_memory_kb.