MS SQL - Store Pix Files

I have not attempted to use XOJO to store a file as a Varbinary(MAX) column in a MS SQL Server table. This would be a BLOB in other DB’s.

I have a new Web App that will require 7 files (1 JPG, and 6 PDF’s) to be “attached” to each row in the DB. This is a fairly low volume app (maybe 100 new rows per month). The actual PDF file sizes should be 50k each or less. The picture file maybe be bigger. I will probably create some limits and reject very large uploads so I am not allowing megabyte size files.

In the past I simply uploaded a file, figured out a unique name related to the DB row, and stored it in a directory and put the file name in a Varchar DB column.

Has anybody used Varbinary(MAX) for MS SQL in a Web App?


Mark, I cannot directly answer your question because this is a topic that I am researching myself at the moment. That said, depending on the version of SQL Server that you are using, there may be other options than varbinary to consider. This link is interesting reading on the topic.

in hope that this can help.

FileStreams look interesting. I am using 2008 R2 and they do appear to be in that version.

They essentially appear to be an integrated method to store the file in a directory but as if it was in a Varbinary(max) column in the DB. SQL Server does all of the work behind the scenes.

I typically have stayed away from storing giant chunks of binary “stuff” in a database because of performance penalties but to manage it yourself can be very tedious. This looks like an alternative.

More research needed. Post back here if you find something interesting and I will do the same.



I personally like Filestream, but this is designed for bigger files you mention.

For small files is best to use varbinary, Care design when implementing varbinary

Sorry for my English