The Common language runtime (CLR) feature allows you to write stored procedures/trigger/functions in .NET managed code and execute the same from SQL Server. However, in order to enable the execution of CLR code, the feature needs to be enabled first. In this blog we’ll see how to enable CLR in SQL Server.

Let’s first see how to find whether CLR feature is enabled or not.

1_Enable CLR in SQL Server

The configuration option for CLR is “clr enabled”. The value_in_use column in above snapshot is 0, which means that CLR is not enabled. Let’s enable it as shown below

The CLR is enabled using the sp_configure stored procedure. “clr enabled” is an advanced configuration option thus “show advanced options” must be enabled.  Let’s verify the status of “clr enabled” option

2_Enable CLR in SQL Server

The value_in_use column is 1 indicating that CLR is enabled.



Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook