Common language runtime (CLR) integration programming concepts
Applies to: SQL Server Azure SQL Managed Instance
SQL Server features the integration of the common language runtime (CLR) component of the .NET Framework for Windows.
You can write stored procedures, triggers, user-defined types, user-defined functions, user-defined aggregates, and streaming table-valued functions, using any language, including C# and Visual Basic .NET.
Remarks
SQL Server CLR integration doesn't support .NET Core, or .NET 5 and later versions.
You can load CLR database objects for SQL Server 2017 (14.x) and later versions on Linux, but they must be built with the .NET Framework. Also, CLR assemblies with the
EXTERNAL_ACCESS
orUNSAFE
permission set aren't supported on Linux.By default, the .NET Framework runtime is installed with SQL Server, but the .NET Framework SDK isn't. To install the latest version of the .NET Framework SDK, see Download .NET Framework Developer Pack.
The
Microsoft.SqlServer.Server
namespace includes core functionality for CLR programming in SQL Server. For documentation on theMicrosoft.SqlServer.Server
namespace, see Microsoft.SqlServer.Server Namespace (.NET Framework 4.8).CLR functionality, such as CLR user functions, aren't supported for Azure SQL Database.
In this section
The following table lists the articles in this section.
Article | Description |
---|---|
Common language runtime (CLR) integration | Provides a brief overview of the CLR, and describes how and why this technology is used in SQL Server. Describes the benefits of using the CLR to create database objects. |
Assemblies (Database Engine) | Describes how assemblies are used in SQL Server to deploy functions, stored procedures, triggers, user-defined aggregates, and user-defined types. These objects are written in one of the managed code languages hosted by the .NET Framework common language runtime (CLR), and not in Transact-SQL. |
Build database objects with common language runtime (CLR) integration | Describes the kinds of objects that can be built using the CLR, and reviews the requirements for building CLR database objects. |
Data access from CLR database objects | Describes how a CLR routine can access data stored in an instance of SQL Server. |
CLR integration security | Describes the CLR integration security model. |
How to debug CLR database objects | Describes limitations of and requirements for debugging CLR database objects. |
Deploy CLR database objects | Describes deploying assemblies to production servers. |
Manage CLR integration assemblies | Describes how to create and drop CLR integration assemblies. |
Monitor and troubleshoot managed database objects | Provides information about the tools that can be used to monitor and troubleshoot managed database objects and assemblies running in SQL Server. |
Usage Scenarios and Examples for Common Language Runtime (CLR) Integration | Describes usage scenarios and code samples using CLR objects. |