The CLR stands for common language runtime and is the heart of the Microsoft .NET Framework. It provides the execution environment for all .NET Framework code. The CLR provides various functions and services required for program execution, such as;
SQL CLR is technology for hosting of the Microsoft .NET common language runtime engine within SQL Server. It was introduced in Microsoft SQL Server 2005.
SQL CLR allows the following types of managed code objects in SQL Server in .NET languages (C# or VB.NET).
The managed code compiles to native code before execution; you can achieve significant performance increases in some scenarios.
By default, the CLR support in the SQL Server database engine is disabled. To enable CLR support, you need to set the
clr enabled option of
sp_configure system stored procedure to 1.
sp_configure 'clr enabled', 1 GO RECONFIGURE GO
You can disable CLR integration by setting the
clr enabled option to 0. When you disable CLR integration, SQL Server stops executing all CLR routines and unloads all application domains.