Why is there no equivalent for hierarchyid SQL data type?
Asked Answered
E

3

5

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.

Effloresce answered 30/7, 2009 at 4:58 Comment(0)
V
6

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.

Vincenty answered 30/7, 2009 at 5:21 Comment(0)
M
2

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

Marentic answered 30/7, 2009 at 6:12 Comment(0)
E
0

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.

Earthen answered 30/7, 2009 at 4:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.