views:

352

answers:

3

I understand it that we have to map this type as binary to get to it in the application code. But why isn't there an exact equivalent with all those type methods?

How are we supposed to work with in the code? Or we aren't supposed to work with it outside SQL environment at all?

EDIT: The question extends to the geography and geometry types as well.

+2  A: 

The client code for the new types is installed separately by the SQL Server 2008 Feature Pack:

Microsoft SQL Server System CLR Types

The SQL Server System CLR Types package contains the components implementing the new geometry, geography, and hierarchyid types in SQL Server 2008. This component can be installed separately from the server to allow client applications to use these types outside of the server.

Remus Rusanu
+1  A: 

All the new types in SQL Server 2008 are available as standard .NET CLR types in your favorite CLR language as well - you'll find SqlHierarchyId, SqlGeometry, SqlGeography, DateTimeOffset, all the new exciting stuff.

These additional assemblies are installed if you install SQL Server 2008 on your machine, or you can download and install them separately as Remus pointed out, as part of the SQL Server 2008 Feature Pack. These types are available from the Microsoft.SqlServer.Types namespace (stored in the assembly by the same name) - except for the DateTimeOffset which is in the base System namespace (with the other date types).

Marc

marc_s
A: 

Here's an interesting post that provides a good guidance on hierarchyid of sql server 2008: http://vaideeswaranr.blogspot.com/2010/01/working-with-hierarchical-data-in-sql.html

May be you can ask your question there.

Prakash