Chapter 29. Persisting Custom Data Types

In This Chapter

  • Understanding the components and requirements of .NET user-defined types in SQL Server 2005

  • Creating CLR integration user-defined types in Visual Studio 2005

  • Debugging and performance considerations for user-defined types

  • Working with CLR integration user-defined types in the database and in .NET applications

User-defined types (UDTs) are new in SQL Server 2005. Don't confuse them with user-defined data types. SQL Server has provided a user-defined data type of limited utility for some time. This legacy T-SQL extension was primarily an intra-database convenience. There was no support for creating a new data type, merely a convenient mechanism for aliasing an existing primitive such as an integer, char, or binary in an effort to provide consistency across the database. It was easier to identify a type relationship in columns in multiple tables and to keep columns of the same purpose in different tables the same length. For example, all such columns could be aliased to the same user-defined data type. However, applications that referenced one of those columns with a user-defined data type would see the column as the underlying native data type. No applications would really care that the user-defined data type had been defined because it had no meaning outside of the local database where it was defined. The user-defined data type was not truly persisted through the application layers.

Note

User-defined types (UDTs) are one of the five ...

Get SQL Server™ 2005 Bible 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.