Enabling CLR Integration in SQL Server 2008

The common language runtime (CLR) integration feature is off by default. You must enable it in order to use objects that are implemented using CLR integration. In this task, you will enable CLR integration using a stored procedure named sp_configure.

1. Start Microsoft SQL Server Management Studio from Start | All Programs | Microsoft SQL Server 2008 R2.

2. Connect to Your Database Server

image

3. Press CTRL+N to open a new query window.

4. Enable SQL Server to execute CLR code. To do this, enter the following Transact-SQL script in the query window.

T-SQL

sp_configure ‘show advanced options’, 1;

GO

RECONFIGURE;

GO

sp_configure ‘clr enabled’, 1;

GO

RECONFIGURE;

GO

Note: The clr enable‘ option is an advance option so you first have to configure SQL Server to show advanced options with the ‘show advanced options‘ option.

5. Press CTRL+E to execute the Transact-SQL statements in the query window and enable CLR integration.

image