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 |
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-05-19 : 15:35:46
|
HiI want to store images in a varbinary field, I currently use Varbinary(MAX), but maybe I can just use Varbinary(50) instead. The images stored there are around 700kb. How large file would I be able to store in a Varbinary(50) field? |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-05-19 : 15:42:44
|
You'll need to use varbinary(max). Varbinary(50) holds up to, believe it or not, 50 bytes. |
 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-05-19 : 15:48:02
|
Totaly useless in other words ;-), is there any tip I need to think of when storing images in DB? |
 |
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2009-05-19 : 16:14:01
|
If these images are going to be accessed a great deal, you probably don't want them in the database. Even varbinary(max) is stored in 8kb pages, so a 700 kb image has to be reconstituted for every access. For something like a website with a lot of traffic, this overhead will add up very quickly. For an internal corporate directory with only a few hundred people, you likely won't notice. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-19 : 16:23:30
|
Any chance you going to use SQL Server 2008? Have a look at FILESTREAM. E 12°55'05.63"N 56°04'39.26" |
 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2009-05-19 : 16:27:47
|
Hi Peso, yes I know about this new function, but I'm not sure on when a purchase of sql server 2008 will be.... |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-05-19 : 16:51:08
|
Varbinary(max) is available in SQL Server 2005. If you have SQL 2000 or earlier, you can use the image data type.edit: sorry, realized you were talking about filestream. |
 |
|
|
|
|
|
|