CLR Integration

CLR integration allows you to author stored procedures, triggers, user-defined functions, user-defined types, and user-defined aggregates in managed code using any .NET Framework language. The common language runtime (CLR) integration feature is off by default in Microsoft SQL Server.

You can disable CLR integration by setting the clr enabled option to 0. When you disable CLR integration, SQL Server stops executing all user-defined CLR routines and unloads all application domains.

Suggested Action

If you need CLR Integration enabled on your SQL Server, it is strongly recommended to enable CLR strict security. If you don’t need CLR Integration, it’s best to disable it.

How to Disable CLR Integration

EXEC sys.sp_configure @configname = N'show advanced options',
                      @configvalue = N'1';
RECONFIGURE;
GO
EXEC sp_configure 'clr enabled', 0;
RECONFIGURE WITH OVERRIDE;
GO
EXEC sys.sp_configure @configname = N'show advanced options',
                      @configvalue = N'0';
RECONFIGURE;
GO

How To Enable CLR Strict Security

EXEC sys.sp_configure @configname = N'show advanced options',
                      @configvalue = N'1';
RECONFIGURE;
GO
EXEC sp_configure 'clr strict security', 1;
RECONFIGURE WITH OVERRIDE;
GO
EXEC sys.sp_configure @configname = N'show advanced options',
                      @configvalue = N'0';
RECONFIGURE;
GO

Further Reading

CLR Integration Security | Microsoft Learn