How to Enable CLR Integration in SQL Server 2008
I recently installed SQL Server 2008 database on my local computer and forgot to enable the common language runtime (CLR). Because I had forgotten to turn it on, some portions of my sites were not fuctioning properly due SQL Server not being able to access the custom assemlies that are part of my db's. By default the common language runtime (CLR) integration feature is turned off, and must be enabled in order to use objects that are coded to use CLR integration.
To enable CLR integration, use the clr enabled option of the sp_configure stored procedure:
- Open SQL Server Management Studio
- Click on the "New Query" button.
- In the query window paste in the following:
sp_configure 'show advanced options', 1;
sp_configure 'clr enabled', 1;
- Now click the "Execute" button to run the stored procedure and change your CLR settings in SQL Server.
- In the SQL Server "Messages" window you should see something similiar to:
Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'clr enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.
- That's it!