Example: Retrieve binary data
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
The following query returns the product photo stored in a varbinary(max) type column. The BINARY BASE64
option is specified in the query to return the binary data in base64-encoded format.
Example
USE AdventureWorks2022;
GO
SELECT ProductPhotoID, ThumbNailPhoto
FROM Production.ProductPhoto
WHERE ProductPhotoID = 1
FOR XML RAW, BINARY BASE64;
GO
Expect the following result:
<row ProductModelID="1" ThumbNailPhoto="base64 encoded binary data"/>
See also
Зворотний зв’язок
https://aka.ms/ContentUserFeedback.
Очікується незабаром: протягом 2024 року ми будемо припиняти використання механізму реєстрації проблем у GitHub для зворотного зв’язку щодо вмісту й замінювати його новою системою зворотного зв’язку. Докладніше:Надіслати й переглянути відгук про