Questions tagged [varbinarymax]

Variable-length binary data type in Microsoft SQL Server, where 'MAX' indicates that the data may hold up to the maximum storage size of 2^31-1 bytes.

142 questions
0
votes
1 answer

Insert varbinary using nanodbc library

I want to read a JPG file in C++ and insert to a MicroSoft SQL Server 2014 (or 2019) database as varbinary(max) type via nanodbc (doc is here and github is here). There are several examples in the doc site. However, I find nothing about inserting…
Babak.Abad
  • 2,839
  • 10
  • 40
  • 74
0
votes
1 answer

Storing and Retrieving PDF Files in Azure SQL Managed Instance

I use Azure SQL Managed Instance as DB and ADLS for file storage. Now the requirement is to store few small PDF files (about 200 kb each). Storing and retrieving will be done through .NET. Which is the best and easiest approach? Storing the PDFs in…
Iniyavan
  • 61
  • 1
  • 5
0
votes
0 answers

Varbinary(max) too large to read in ASP.NET Core

In the database I use a column of datatype varbinary(max) to save an image, but when I load the image, I get a timeout. public async Task UploadImage(IFormFile req) { using var ms = new MemoryStream(16 * 1024); await…
Duy
  • 1
  • 1
0
votes
1 answer

Convert varbinary(max) column from Azure SQL database into local image file

We have an Azure SQL database with a table which contains a number of images in a varbinary(max) column. I would like to be able to extract these to image files to be stored locally. I have found various posts and code snippets for doing this from a…
BiigJiim
  • 165
  • 1
  • 1
  • 10
0
votes
0 answers

getting different file size when reading pdf from disc to varbinary(max) column and subsequently bcp-ing it back to disc

So in setting the test environment for SQL Agent job I'm working on I populated a varbinary(max) field from a pdf file on disc using OPENROWSET like so DECLARE @File varbinary(max) SELECT @File=BulkColumn FROM OPENROWSET (BULK 'v:\DIMA.pdf',…
0
votes
0 answers

When I write a string to an image field in SQL it gets saved in UTF-16 LE encoding and I need it to be UTF-8

I have about 1200 databases in SQL 2016 Enterprise in which documents are stored as BLOB's in image fields in the database. I migrated all the documents to our Document Management System and now I want to replace the files in the database with…
0
votes
3 answers

How to convert varbinary(max) to base64 SQL Server 2014

I have an Image saved as varbinary(max) in SQL Server 2014: 0xFFD8FFE115064578696600004D4D002A0000000800070........... I want to convert it to Base64 To use it in Flutter. I tried SELECT CAST('' as varbinary(max)) FOR XML PATH(''), BINARY…
BaselCS
  • 13
  • 3
0
votes
0 answers

Add a Word docx as a DEFAULT to a varbinary(max) column

I would like to store MS Word documents (docx) in SQL Server by default. What I have been able to do so far is create a varbinary(max) column in SQL Server, link to this table via MS Access, and drag Word documents into this column via MS Access…
0
votes
1 answer

yii2 and mssql insert varbinary into model

Hi everyone I have a sql server table that contains fields that are of type varbinary. The table model sees the field as a string, when it tries to save it it gives me the following error SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL…
0
votes
0 answers

How to insert a pdf or image to SQL server

I'm trying to add an img from my own computer for testing and I need to upload an img or pdf to a column in SQL Server as a varbinary data type. the table has 6 columns; description, img, date, etc.. how do I upload the img or pdf when I have more…
0
votes
1 answer

SQL: Update table with a picture from folder, by id #

I have a table at the moment with columns ( id#(int), picture(varbinary(MAX) ), and I have a folder on my HDD with a ton of pictures. The pictures in the folder are named by the 'id' I want to match them with in my table. How can I do…
fwaokda
  • 15
  • 2
  • 5
0
votes
0 answers

Trying to update SQL Blob in table (Varbinary(max) data type in database

update dbo.blobs set blob = (select convert (varbinary(max),…
0
votes
0 answers

Displaying varbinary image from SQL database in Access 365 front end

I have a SQL database, a website created using Visual Studios/Visual Basic, and an Access 365 front end. The Access database is for "management" of the data - not really good at creating websites so this is the fastest way to get this database out…
user3033348
  • 145
  • 13
0
votes
1 answer

Saving a generated PNG file to SQL Server varbinary(max)

I've created a drawing app in Silverlight that generates a png file from an InkPresenter control when the user hits a "Save" button. I used code from the following article to accomplish the png…
lamarant
  • 3,243
  • 2
  • 25
  • 30
0
votes
0 answers

BCP utility 13.0 bug with varbinary(max)

I followed Microsoft's command bcp db..someTable ​format ... to create a fmt file. The table contains a varbinary(max) column. The resultant fmt file looks like this 13.0 1 1 SQLCHAR 0 0 "\r\n" ... When I use this fmt file to bcp "SELECT…