{
	"id": "c4df34cf-6acc-44f0-88de-62526bd39d59",
	"created_at": "2026-04-06T00:16:34.355563Z",
	"updated_at": "2026-04-10T03:24:29.394256Z",
	"deleted_at": null,
	"sha1_hash": "d0ce88328142c591000f620a1a60bc16bf4244c8",
	"title": "Common Language Runtime (CLR) Overview - SQL Server",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 51526,
	"plain_text": "Common Language Runtime (CLR) Overview - SQL Server\r\nBy rwestMSFT\r\nArchived: 2026-04-05 17:07:39 UTC\r\nApplies to: SQL Server Azure SQL Managed Instance\r\nSQL Server and Azure SQL Managed Instance enable you to implement some of the functionalities with .NET\r\nlanguages using the native common language runtime (CLR) integration as SQL Server server-side modules\r\n(procedures, functions, and triggers). The CLR supplies managed code with services such as cross-language\r\nintegration, code access security, object lifetime management, and debugging and profiling support.\r\nFor SQL Server users and application developers, CLR integration means that you can write stored procedures,\r\ntriggers, user-defined types, user-defined functions (scalar and table valued), and user-defined aggregate functions\r\nusing any .NET Framework language, including C# Visual Basic .NET. SQL Server includes the .NET Framework\r\nversion 4 preinstalled.\r\nThis 6-minute video shows you how to use CLR in Azure SQL Managed Instance:\r\nCode access security no longer supported\r\nCLR uses Code Access Security (CAS) in the .NET Framework, which is no longer supported as a security\r\nboundary. A CLR assembly created with PERMISSION_SET = SAFE might be able to access external system\r\nresources, call unmanaged code, and acquire sysadmin privileges. In SQL Server 2017 (14.x) and later versions,\r\nthe sp_configure option, clr strict security, enhances the security of CLR assemblies. clr strict security is\r\nenabled by default, and treats SAFE and EXTERNAL_ACCESS assemblies as if they were marked UNSAFE . The\r\nclr strict security option can be disabled for backward compatibility, but isn't recommended.\r\nWe recommend that you sign all assemblies by a certificate or asymmetric key, with a corresponding login that has\r\nbeen granted UNSAFE ASSEMBLY permission in the master database. SQL Server administrators can also add\r\nassemblies to a list of assemblies, which the Database Engine should trust. For more information, see\r\nsys.sp_add_trusted_assembly.\r\nWhen to use CLR modules\r\nCLR Integration enables you to implement complex features that are available in .NET Framework such as regular\r\nexpressions, code for accessing external resources (servers, web services, databases), custom encryption, etc.\r\nSome of the benefits of the server-side CLR integration are:\r\nA better programming model. The .NET Framework languages are in many respects richer than Transact-SQL, offering constructs and capabilities previously not available to SQL Server developers. Developers\r\ncan also use the power of the .NET Framework Library, which provides an extensive set of classes that can\r\nbe used to quickly and efficiently solve programming problems.\r\nhttps://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/common-language-runtime-integration-overview?view=sql-server-2017\r\nPage 1 of 2\n\nImproved safety and security. Managed code runs in a common language run-time environment, hosted\r\nby the Database Engine. SQL Server uses this to provide a safer and more secure alternative to the\r\nextended stored procedures available in earlier versions of SQL Server.\r\nAbility to define data types and aggregate functions. User-defined types and user-defined aggregates are\r\ntwo new managed database objects that expand the storage and querying capabilities of SQL Server.\r\nStreamlined development through a standardized environment. Database development is integrated\r\ninto future releases of the Visual Studio .NET development environment. Developers use the same tools for\r\ndeveloping and debugging database objects and scripts as they use to write middle-tier or client-tier .NET\r\nFramework components and services.\r\nPotential for improved performance and scalability. In many situations, the .NET Framework language\r\ncompilation and execution models deliver improved performance over Transact-SQL.\r\nSQL Server Language Extensions provide an alternative execution environment for runtimes close to the Database\r\nEngine. For a discussion of the differences between SQL CLR and SQL language extensions, see Compare SQL\r\nServer Language Extensions to SQL CLR.\r\nThe following table lists the articles in this section.\r\nRelated content\r\n.NET Framework installation guide\r\nPerformance of CLR integration architecture\r\nSource: https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/common-language-runtime-integration-overview?view=sql-se\r\nrver-2017\r\nhttps://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/common-language-runtime-integration-overview?view=sql-server-2017\r\nPage 2 of 2",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/common-language-runtime-integration-overview?view=sql-server-2017"
	],
	"report_names": [
		"common-language-runtime-integration-overview?view=sql-server-2017"
	],
	"threat_actors": [
		{
			"id": "aa73cd6a-868c-4ae4-a5b2-7cb2c5ad1e9d",
			"created_at": "2022-10-25T16:07:24.139848Z",
			"updated_at": "2026-04-10T02:00:04.878798Z",
			"deleted_at": null,
			"main_name": "Safe",
			"aliases": [],
			"source_name": "ETDA:Safe",
			"tools": [
				"DebugView",
				"LZ77",
				"OpenDoc",
				"SafeDisk",
				"TypeConfig",
				"UPXShell",
				"UsbDoc",
				"UsbExe"
			],
			"source_id": "ETDA",
			"reports": null
		}
	],
	"ts_created_at": 1775434594,
	"ts_updated_at": 1775791469,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/d0ce88328142c591000f620a1a60bc16bf4244c8.pdf",
		"text": "https://archive.orkl.eu/d0ce88328142c591000f620a1a60bc16bf4244c8.txt",
		"img": "https://archive.orkl.eu/d0ce88328142c591000f620a1a60bc16bf4244c8.jpg"
	}
}