Bagikan melalui


CLR User-Defined Types (ADO.NET)

Microsoft SQL Server 2005 added support for user-defined types (UDTs) implemented with the Microsoft .NET Framework common language runtime (CLR). The CLR is integrated into SQL Server, and this new mechanism enables you to extend the type system of the database. UDTs provide user extensibility of the SQL Server data type system, and also the ability to define complex structured types.

UDTs can provide two key benefits from an application architecture perspective:

  • Strong encapsulation (both in the client and the server) between the internal state and the external behaviors.

  • Deep integration with other related server features. Once you define your own UDT, you can use it in all contexts where you can use a system type in SQL Server, including column definitions, and as variables, parameters, function results, cursors, triggers, and replication.

For more detailed information, see the version of SQL Server Books Online for the version of SQL Server you are using.

SQL Server 2005

SQL Server 2008

CLR User-Defined Types

CLR User-Defined Types

See Also

Other Resources

Creating SQL Server 2005 Objects in Managed Code

ADO.NET Managed Providers and DataSet Developer Center