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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Size of Varbinary(50)

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2009-05-19 : 15:35:46
Hi

I 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.
Go to Top of Page

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?
Go to Top of Page

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.
Go to Top of Page

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"
Go to Top of Page

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....
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -