views:

29

answers:

1

I have database items that have 2 external resources: A.) images and B.) HTML files.

Should these be stored as columns in the DB, or should the DB just hold pointers to the filesystem?

What are the pros and cons of each approach?

HTML files are about 200k per item, and Images are about 200k per item (5 - 10 pics or so max)

Thanks.

A: 

With everything, "It Depends".

Personally, if you have a good reason to store them in the database, I'd strongly consider storing them in the database as image/ntext/varbinary (blob) columns.

I'd advocate against storing paths to the local file system because this makes moving your database to a different machine difficult in that your paths stored in the database will very possibly be invalid.

You may want to investigate SQL2008's FILESTREAM blob-column modifier. A short synopsis of the feature can be found at http://blogs.msdn.com/pedram/archive/2007/06/04/store-any-data-in-sql-server-2008-katmai.aspx and more details than you can shake a stick at: http://technet.microsoft.com/en-us/library/bb933993.aspx

Yoopergeek