Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
azerbaycanli113
Starting Member
5 Posts |
Posted - 2010-12-08 : 07:59:37
|
HI, I have a table with a column named 'Docs' which I use to store jpeg files. Obviously, after a while the database will grow to a huge amount of size which in turn will affect the querying performance. My boss tells me there is probably a way we can store jpeg files in a XML file and read information from that file.But I don't really know how to do it.Can someone explain briefly how it's done ?If that's not the case, then what is the best way to store large files like images, sound files with less size than that of the file itself. |
|
DaleTurley
Yak Posting Veteran
76 Posts |
Posted - 2010-12-08 : 09:27:53
|
If you're using SQL Server 2008 look into Filestream. If not you could store just a path to the image in the database and the images on a fileshare. |
 |
|
azerbaycanli113
Starting Member
5 Posts |
Posted - 2010-12-09 : 00:44:21
|
Thanks bud. It's a really good idea. But I've recently heard about ndf files. Is that true that with it's help we can shrink a database thus enhance querying performance? |
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-12-09 : 03:18:58
|
First question is: Do you need to store the images in the database at all? If not store them in the filesystem and store the path / filename in the database.Using hierarchical backup strategies for files is easy, well understood, and lots of products available. Heck! you can just the file-level ARCHIVE property.Storing them in the database you have to back up the whole lot. Sure, you can move them to a separate file but you still have to back THAT file up IN FULL.And if you want to restore, and you have multiple files / backups then you run the risk that you have relational integrity problems after the restore.If you need to transfer database and images AS A UNIT to other systems, or you must have relational integrity between images and other data, or possibly where the access to images must be restricted, those may be good reasons for putting the images IN the database. But most times it is better to keep them outside. IMHO |
 |
|
|
|
|