SQL Server: How to check if CLR is enabled? SQL Server: How to check if CLR is enabled? sql-server sql-server

SQL Server: How to check if CLR is enabled?


SELECT * FROM sys.configurationsWHERE name = 'clr enabled'


Check the config_value in the results of sp_configure

You can enable CLR by running the following:

sp_configure 'show advanced options', 1;GORECONFIGURE;GOsp_configure 'clr enabled', 1;GORECONFIGURE;GO

MSDN Article on enabling CLR

MSDN Article on sp_configure


The accepted answer needs a little clarification. The row will be there if CLR is enabled or disabled. Value will be 1 if enabled, or 0 if disabled.

I use this script to enable on a server, if the option is disabled:

if not exists(    SELECT value    FROM sys.configurations    WHERE name = 'clr enabled'     and value = 1)begin    exec sp_configure @configname=clr_enabled, @configvalue=1    reconfigureend