Chapter 11. CLR User-Defined Types

Dejan Sarka

Since the advent of .NET integration in SQL Server 2005, you can create CLR-based User-Defined Types (UDTs) using a .NET language of your choice. Personally, I did not see many common language runtime (CLR) UDTs in production. I guess this is because DBAs are still somehow afraid of using CLR code in a relational database management system. My intention in this chapter is to show that CLR types can be useful. However, I am not dealing with practical issues only.

The most important new feature in Microsoft SQL Server 2008 dealing with CLR UDTs is their size. In SQL Server 2005, CLR UDTs were limited to 8,000 bytes. In SQL Server 2008, you can create large objects (LOBs), up to 2 GB, using CLR UDTs. In ...

Get Inside Microsoft® SQL Server® 2008: T-SQL Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.