Groups | Blog | Home
all groups > sql server programming > february 2007 >

sql server programming : advice - store big file in a DB


ina
2/21/2007 11:49:21 PM
Hello Guys,

I would like to store big file in database? (between 3 to100 pages
with pictures)

What do you advice to do? storing the information in ntext field? or a
link to this file?

I would like to generate report querying this table and have all the
information in a whole and unique file (e.g. *.doc)

Any suggestion will be very appreciate

Ina
Uri Dimant
2/22/2007 12:00:00 AM
ina
I would recommed you to store the files on file system rather that in db

Reasons why
1) What if you would upgrade/move to another platform or a new version of
databse , cannot be sure that format of the files will be corrupted or
whatever
2) Load time the picture from the db takes time , especially you store a big
pictures
3) If you delete the rows from the db , the file is still on file system
( yes you can do backup/restore)




[quoted text, click to view]

Stefan Delmarco
2/22/2007 12:00:00 AM
If you still want to store your files in the database, use an IMAGE (SQL 2000) or VARBINARY(MAX) (SQL 2005) field. Using
these data types will also allow you to leverage SQL's full text search for these files.

--
Cheers,
Stefan Delmarco

http://www.fotia.co.uk


vt
2/22/2007 12:00:00 AM
Ina,

I recon you should store the file separately in system and just put the
location I table. If you store picture in db, performance will be very poor.
I absolutely agree with Uri's comment

VT



[quoted text, click to view]

ina
2/22/2007 2:03:32 AM
[quoted text, click to view]

Thank you very much for this information. :D :D I was thinking about
to store all in DB as I would like to be able to produce rapport in
access project .adp. But definitely build a file system it is much
more easy and trustful

ina
Chris
3/6/2007 10:44:48 AM
When storing the location of the file in the database, would you store the
directory path and file name or just the file name?

I am trying to determine which would be best. I understand that if you
store the directory and then the directory changes you need to update all of
your data. But then if you store the filename and let your application worry
about the location, you are now relying on the application to tell you where
it is unless you document the directory somewhere.

Thanks
Chris

[quoted text, click to view]
AddThis Social Bookmark Button