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 2000 Forums
 SQL Server Development (2000)
 Image field vs varbinary

Author  Topic 

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2003-11-06 : 16:19:00
Hello all. I have a table that has an image field in it. I am storing the binary value of icons in it.

Here is my question, is it more efficient to have this column be of type Image instead of varbinary? Also, if you could explain the benefits of one over the other I would be very appreciative. I can tell you that I don't need the lecture about not storing images in my database period, it ain't an option.

Thanks all!

Aj

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-11-06 : 16:36:50
Image:
Variable-length binary data from 0 through 231-1 (2,147,483,647) bytes.

Varbinary:
Variable-length binary data of n bytes. n must be a value from 1 through 8,000. Storage size is the actual length of the data entered + 4 bytes, not n bytes.


So the question is if you are going to have images that are larger than what varbinary supports, which is approximately 8KB if I'm not mistaken.






Tara
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-11-06 : 16:37:50
They look the same...varbinary is just limited to 8k though...not very big for an image...

But I guess in this case small would be good...no?



Brett

8-)

EDIT: [snipped] by 1 minute
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2003-11-06 : 16:47:43
Hopefully it won't be anything over 25K, but you never know.

I will stick with image for now.

Thanks!

Aj
Go to Top of Page
   

- Advertisement -