Friday, February 5, 2010

How to enable CLR on SQL Server 2005


You need to enable the Common Language Run-time (CLR) on SQL Server 2005 in order to run .net functions; but default this feature is not enabled for security. If you try to run a CLR function you will get the next error message:
Msg 6263, Level 16, State 1, Line 1
Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option.
To fix this problem run the next code using SQL Managment Studio:
sp_configure 'clr enabled'
go
reconfigure
go
You will get the next message to indicate you can run CLR functions:
Configuration option 'clr enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.


Another way to enable the CLR is:
1. Explore SQL Server 2005//Configuration Tools//SQL Server Surface Area Configuration
2. Select "Surface Area Configuration for Features"
3. Click on CLR Integration
4. Check the "Enable CLR Integration" Checkbox



No comments:

Post a Comment