Example: Retrieving Binary Data
Następująca kwerenda zwraca fotografię produktu, przechowywane w varbinary(max) Typ kolumna. The BINARY BASE64 option is specified in the query to return the binary data in base64-encoded format.
Przykład
USE AdventureWorks
GO
SELECT ProductPhotoID, ThumbNailPhoto
FROM Production.ProductPhoto
WHERE ProductPhotoID=1
FOR XML RAW, BINARY BASE64 ;
GO
Oto wynik:
<row ProductModelID="1" ThumbNailPhoto="base64 encoded binary data"/>