Saturday 7 September 2013

Enable CLR Integration in SQL Server 2008

Posted by Sarath On Saturday, September 07, 2013 No comments
By default the common language runtime (CLR) integration feature is turned off. If it is turned off, SQL server won't be able to access the custom assemlies that are part of your database (if the database contains objects that are coded to use CLR integration). CLRmust be enabled in order to use objects that are coded to use CLR integration.

To check :
Open SQL Management Studio, click on the "New Query" button. In the query window paste the following and click the "Execute" button :
Code: 
SELECT * FROM sys.configurations
WHERE name = 'clr enabled'

To enable CLR integration, use the clr enabled option of the sp_configure stored procedure:

Execute the below query :

Code: 
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO

Then click the "Execute" button to run the stored procedure.

In the SQL Server "Messages" window you should see messages similar to below ones :
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 all..!!

0 comments: