Retrieving binary data from SQL Server using T-SQL

I have a database to which I upload files (e.g. PDF files, images, etc.). I save them in the database as Varbinary (max).

I upload these files using C # MVC. I was wondering how I can view these files using a T-SQL query, not .net.

Is it possible?

+4
source share
3 answers

Not directly.

Why don't you write a simple application to view?

There are free and commercial ones. I have not used this, but it has a trial version: SQL Image Viewer

+4
source

No, you need to extract the files to view them.

SQL Server and SSMS (SQL Server Management Studio) are not able to view binary data in this way.

+1
source

You can use the sp_OAxxxx functions (COM interaction functions) to create the appropriate viewers, but ultimately these viewers will need the data recorded on the disc.

0
source

All Articles