Storing Images in database - good or bad?

  • Thread starter Thread starter Ig
  • Start date Start date
I

Ig

Hi,
Could somebody explain is it worth to store images in database instead of in
flat files
with pointers from database to these files?
I have Access 2000 as frontend and SQL Server as backend.
 
Someone else with more experience here may have a better answer, but
here's what's coming to mind for me:

Pros (of storing it in the database):
The pictures travel with the database.
A form can automatically display the picture stored in the database
without having to write code.

Cons:
The size of your database will grow slowing down reading and writing
to it.
Unless you setup the pictures in a separate table with a one-to-many
relationship, you'll have to store the picture more than once if it
applies to more than one record.
A little harder to share the picture with someone else.

If it were me, then if it's just a few pictures then I'd be tempted to
store it in the database, otherwise I'd keep them separate.

Tom Collins



| Hi,
| Could somebody explain is it worth to store images in database
instead of in
| flat files
| with pointers from database to these files?
| I have Access 2000 as frontend and SQL Server as backend.
|
|
 
If you are in SQL Server and your Server has enough drive space, you can
store them in the database, but I would recommend NOT saving them as OLE
object. Rather you should have a function the streams the file into an
Image data type field. When you need to show the image you stream the field
out into a file that your system can use.

Search in Microsofts knowledge base and MSDN for lots of references to this.

Jim
 
Hi,
Could somebody explain is it worth to store images in database instead
of in flat files
with pointers from database to these files?
I have Access 2000 as frontend and SQL Server as backend.

Depends on the size and quantity of images. I tend to link rather than
save into DB.
 
Per "Tom Collins said:
Pros (of storing it in the database):
- The pictures travel with the database.
- A form can automatically display the picture stored in the database
without having to write code.

- You can't lose images. OTOH with pointers, if an image goes to The Great Bit
Bucket In The Sky, you'll never know until somebody tries to exercise the
pointer.

Having said that, I've always opted for the pointers because of DB size issues.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top