[thelist] SQLServer and images

Ken Schaefer ken at adOpenStatic.com
Wed May 12 20:23:43 CDT 2004


You can do this, whether you'd want to is another question :-)
Cons:
You'll need to write more code to get the images in, and out.
You can't just "export" the images
Performance will be much slower
DB "bloat"

Pros
Everything is in the one place - makes maintaining integrity within the DB
and image files easier
If you need to do a backup, you can just backup the database

For data types, you could use varBinary (up to 8,000 bytes), or Image (up to
~2 billion bytes). However using an Image field means you'll probably need
to use GetChunk and AppendChunk to get the data out, and put it in.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;194975

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chris Marsh" <chris at martiantechnologies.com>
Subject: [thelist] SQLServer and images


: I have an ASP script that allows me to upload images to the server. I am
: currently BinaryWriting the contents of the image file to a text file on
: the server, and then saving the location of the file to a database. What
: I now want to do is store the image *itself* in the database in binary
: format. Is this possible, and if so how would I go about it?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the thelist mailing list