SqlHierarchyId 구조
The SqlHierarchyId type represents a position in a hierarchical structure, specifying depth and breadth.
네임스페이스: Microsoft.SqlServer.Types
어셈블리: Microsoft.SqlServer.Types(Microsoft.SqlServer.Types.dll)
구문
‘선언
<SqlUserDefinedTypeAttribute(Format.UserDefined, IsByteOrdered := True, _
MaxByteSize := , Name := "SqlHierarchyId")> _
<CLSCompliantAttribute(True)> _
Public Structure SqlHierarchyId _
Implements IBinarySerialize, INullable, IComparable
‘사용 방법
Dim instance As SqlHierarchyId
[SqlUserDefinedTypeAttribute(Format.UserDefined, IsByteOrdered = true,
MaxByteSize = , Name = "SqlHierarchyId")]
[CLSCompliantAttribute(true)]
public struct SqlHierarchyId : IBinarySerialize,
INullable, IComparable
[SqlUserDefinedTypeAttribute(Format::UserDefined, IsByteOrdered = true,
MaxByteSize = , Name = L"SqlHierarchyId")]
[CLSCompliantAttribute(true)]
public value class SqlHierarchyId : IBinarySerialize,
INullable, IComparable
[<SealedAttribute>]
[<SqlUserDefinedTypeAttribute(Format.UserDefined, IsByteOrdered = true,
MaxByteSize = , Name = "SqlHierarchyId")>]
[<CLSCompliantAttribute(true)>]
type SqlHierarchyId =
struct
interface IBinarySerialize
interface INullable
interface IComparable
end
Jscript는 구조체의 사용을 지원하지만 새로운 구조체 선언은 지원하지 않습니다.
SqlHierarchyId 유형에서 다음 멤버를 표시합니다.
속성
이름 | 설명 | |
---|---|---|
![]() |
IsNull | Gets a value indicating whether the SqlHierarchyId is nullNothingnullptrunitnull 참조(Visual Basic에서는 Nothing). |
![]() ![]() |
Null | Gets a SqlHierarchyId with a hierarchy identification of nullNothingnullptrunitnull 참조(Visual Basic에서는 Nothing). |
맨 위로 이동
메서드
이름 | 설명 | |
---|---|---|
![]() |
CompareTo(Object) | Returns a value indicating the results of a comparison between a SqlHierarchyId and an object. |
![]() |
CompareTo(SqlHierarchyId) | Returns a value indicating the results of a comparison between two SqlHierarchyId nodes. |
![]() |
Equals | Evaluates whether SqlHierarchyId and obj are equal. (ValueType. . :: . .Equals(Object)을(를) 재정의함) |
![]() |
Finalize | (Object에서 상속됨) |
![]() |
GetAncestor | Retrieves the SqlHierarchyId node n levels up the hierarchical tree. |
![]() |
GetDescendant | Gets the value of a descendant SqlHierarchyId node that is greater than child1 and less than child2. |
![]() |
GetHashCode | Gets a hash of the path from the root node of the hierarchy tree to the SqlHierarchyId node. (ValueType. . :: . .GetHashCode() () () ()을(를) 재정의함) |
![]() |
GetLevel | Gets a value indicating the level of the SqlHierarchyId node in the hierarchical tree. |
![]() |
GetReparentedValue | Gets a value representing the location of a new SqlHierarchyId node that has a path from newRoot equal to the path from oldRoot to this, effectively moving this to the new location. |
![]() ![]() |
GetRoot | Gets a value representing the root SqlHierarchyId node of the hierarchy. |
![]() |
GetType | (Object에서 상속됨) |
![]() |
IsDescendantOf | Gets a value indicating whether the SqlHierarchyId node is the descendant of the parent. |
![]() |
MemberwiseClone | (Object에서 상속됨) |
![]() ![]() |
Parse | Converts the canonical string representation of a SqlHierarchyId node to a SqlHierarchyId value. |
![]() |
Read | Reads from a specified binary reader into a SqlHierarchyId. |
![]() |
ToString | Returns the canonical string representation of a SqlHierarchyId node from a SqlHierarchyId value. (ValueType. . :: . .ToString() () () ()을(를) 재정의함) |
![]() |
Write | Writes a SqlHierarchyId to a specified binary writer. |
맨 위로 이동
연산자
이름 | 설명 | |
---|---|---|
![]() ![]() |
Equality | Evaluates whether two SqlHierarchyId nodes are equal. |
![]() ![]() |
GreaterThan | Evaluates whether one specified SqlHierarchyId node is greater than another. |
![]() ![]() |
GreaterThanOrEqual | Evaluates whether one specified SqlHierarchyId node is greater than or equal to another. |
![]() ![]() |
Inequality | Evaluates whether two SqlHierarchyId nodes are unequal. |
![]() ![]() |
LessThan | Evaluates whether one specified SqlHierarchyId node is less than another. |
![]() ![]() |
LessThanOrEqual | Evaluates whether one specified SqlHierarchyId node is less than or equal to another. |
맨 위로 이동
주의
This type provides the following benefits for storing hierarchical information:
Very compact data storage.
Depth-first comparison. Indexes on this type are in depth-first order, and nodes close to each other in a depth-first traversal are stored near each other.
Support for arbitrary insertions and deletions.
A limitation of this type is that a single instance of the hierarchy data type can be no larger than 892 bytes. Hierarchies that possess too many levels to fit within this limitation must use a different data type.
The HierarchyId type is available to CLR clients as the SqlHierarchyId data type.
예
DECLARE @employee hierarchyid
SELECT @employee = OrgNode FROM HumanResources.EmployeeDemo
WHERE LoginID = 'adventure-works\dylan0'
SELECT * FROM HumanResources.EmployeeDemo
WHERE @employee.IsDescendantOf(OrgNode) = 1
스레드 보안
이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.