Write (Database Engine)
Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance
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.
Syntax
void Write( BinaryWriter w )
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
Arguments
w
A BinaryWriter object to which the binary representation of this hierarchyid node will be written out.
Return Types
CLR return type:void
Remarks
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.
Examples
MemoryStream stream = new MemoryStream();
BinaryWriter bw = new BinaryWriter(stream);
hid.Write(bw);
byte[] encoding = stream.ToArray();
See also
Read (Database Engine)
ToString (Database Engine)
CAST and CONVERT (Transact-SQL)
hierarchyid Data Type Method Reference
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho