(Veritabanı Altyapısı) ayrıştırılamadı.
Parse converts the canonical string representation of a hierarchyid to a hierarchyid value.Parse is called implicitly when a conversion from a string type to hierarchyid occurs.Acts as the opposite of ToString.Parse() is a static method.
-- Transact-SQL syntax
hierarchyid::Parse ( input )
-- This is functionally equivalent to the following syntax
-- which implicitly calls Parse():
CAST ( input AS hierarchyid )
-- CLR syntax
static SqlHierarchyId Parse ( SqlString input )
Bağımsız değişkenler
input
Transact-SQL: Karakter verileri dönüştürülmüş bir değer yazın.clr: Değerlendirilen bir dize değeri.
Dönüş Türleri
**SQL Server dönüş türü:**hierarchyid
**CLR dönüş türü:**SqlHierarchyId
Remarks
If Parse Geçerli dize gösterimine, olmayan bir değer alır bir hierarchyid, bir özel duruma neden oldu. Örneğin, char veri türleri, sonunda boşluk içeren, bir özel duruma neden oldu.
Örnekler
C.Transact-SQL değerleri olmadan dönüştürme bir tablo
Aşağıdaki kod örneği kullanır. ToString dönüştürülecek bir hierarchyid bir dize değerine ve Parse bir dize değerine dönüştürmek için bir hierarchyid.
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
Here is the result set.
hierarchyidRepresentation StringRepresentation
------------------------- -----------------------
0x5ADE /1/1/3/
b.CLR örnek
Parçacık çağrıları aşağıdaki kod Parse() yöntem:
string input = “/1/2/”;
SqlHierarchyId.Parse(input);
See Also