Storing and Retrieving Binary Data in SQL Server Sometimes it is
necessary to save binary data such as zip files, pictures or
office documents into the database. Even if these files are
extracted from the database it is sometimes better to store the
document rather than recreate it through another query to the
database. Also there may be a need to archive an exact replica
of a document that a customer has received. In this example we
first compress all the .html and .csv files that have been
delievered to a customer. A zip file of all the reporting
documents is thus created. Then we insert the zip file into the
SQL Server database along with the customer number and week
number. It is then saved and we are free to overwrite any of the
existing reports. The field that holds the zip file has an image
datatype. One might think that the image datatype is just for
graphic files such .jpeg, .gif or .bmp and the datatype to use
would be varbinary or binary. The naming of the datatypes is
misleading. In SQL Server 6.5