Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Write (Database Engine)


Applies To: SQL Server 2014, SQL Server 2016 Preview

Write writes out a binary representation of SqlHierarchyId to the passed-in BinaryWriter. Write cannot be called by using Transact-SQL. Use CAST or CONVERT instead.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.

void Write( BinaryWriter w ) 


A BinaryWriter object to which the binary representation of this hierarchyid node will be written out.

CLR return type: void

Write is used internally by SQL Server when it is necessary, such as when loading data from a hierarchyid column. Write is also called internally when a conversion is done between hierarchyid and varbinary.

MemoryStream stream = new MemoryStream();
BinaryWriter bw = new BinaryWriter(stream);
byte[] encoding = stream.ToArray();

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft