O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a SQL CLR User-Defined Type

Thanks to the SQL CLR, you can write .NET code to store your own custom data types in a SQL Server 2005 database.

Not all data can be represented in data types that SQL Server natively supports. Perhaps you want to store a date/time value that includes a time zone. Maybe you want a column in a table to contain values that represent a point in three-dimensional space or a location based on very precise GPS coordinates. If you can describe the structure of your type using .NET code, you can store data in a SQL Server 2005 database using that code.

This portion of the chapter will construct a user-defined SQL CLR type that contains the line items for an order and store that data in a column in the Orders table. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required