Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CompareTo Method (SqlHierarchyId)
Collapse the table of content
Expand the table of content

SqlHierarchyId.CompareTo Method (SqlHierarchyId)

Returns a value indicating the results of a comparison between two SqlHierarchyId nodes.

Namespace:  Microsoft.SqlServer.Types
Assembly:  Microsoft.SqlServer.Types (in Microsoft.SqlServer.Types.dll)

public int CompareTo(
	SqlHierarchyId hid


Type: Microsoft.SqlServer.Types.SqlHierarchyId
A SqlHierarchyId node to compare to this.

Return Value

Type: Int32
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:



Less than zero

this is less than obj.


this is equal to obj.

Greater than zero

this is greater than obj.

If both SqlHierarchyId nodes are null, returns 0.

If one SqlHierarchyId node is null, it is considered to be less than the non-null SqlHierarchyId node.

Community Additions

© 2015 Microsoft