SqlHierarchyId.Parse 方法 (SqlString)

 

SqlHierarchyId 节点的规范字符串表示形式转换为 SqlHierarchyId 值。

命名空间:   Microsoft.SqlServer.Types
程序集:  Microsoft.SqlServer.Types(位于 Microsoft.SqlServer.Types.dll)

语法

[SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, IsDeterministic = true, 
    IsPrecise = true, IsMutator = false)]
public static SqlHierarchyId Parse(
    SqlString input
)
public:
[SqlMethodAttribute(DataAccess = DataAccessKind::None, SystemDataAccess = SystemDataAccessKind::None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, IsDeterministic = true, 
    IsPrecise = true, IsMutator = false)]
static SqlHierarchyId Parse(
    SqlString input
)
[<SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None,
    InvokeIfReceiverIsNull = false, OnNullCall = false, IsDeterministic = true,
    IsPrecise = true, IsMutator = false)>]
static member Parse : 
        input:SqlString -> SqlHierarchyId
<SqlMethodAttribute(DataAccess := DataAccessKind.None, SystemDataAccess := SystemDataAccessKind.None,
    InvokeIfReceiverIsNull := False, OnNullCall := False, IsDeterministic := True,
    IsPrecise := True, IsMutator := False)>
Public Shared Function Parse (
    input As SqlString
) As SqlHierarchyId

参数

返回值

Type: Microsoft.SqlServer.Types.SqlHierarchyId

表示规范描述的节点的 SqlHierarchyId

备注

从到字符串类型的转换时将隐式调用 SqlHierarchyId ,将发生数据类型。

作用与 ToString 相反。

如果引发异常 Parse接收不是有效的字符串表示形式的值 SqlHierarchyId

此成员是 static

示例

DECLARE @StringValue AS nvarchar(4000), @hierarchyidValue AS hierarchyid
SET @StringValue = '/1/1/3/'
SET @hierarchyidValue = 0x5ADE

SELECT hierarchyid::Parse(@StringValue) AS hierarchyidRepresentation,
 @hierarchyidValue.ToString() AS StringRepresentation ;
GO

另请参阅

SqlHierarchyId 结构
Microsoft.SqlServer.Types 命名空间

返回页首