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
 Transact-SQL (2005)
 image datatype and varbinary(MAX)??

Author  Topic 

aravindt77
Posting Yak Master

120 Posts

Posted - 2007-07-12 : 01:19:21
Hi All ,


what is the difference between image datatype and varbinary(MAX)??

Which one is more advantageous in storing image ??


Plz do the needful

Thanks & Regards

Aravind T

cas_o
Posting Yak Master

154 Posts

Posted - 2007-07-12 : 07:28:53
image datatype is specifically for images and you don't have to specify the size.

The significant differences is that BOL 2005 says the image data type is being deprecated and you should use
varbinary(max) from now on.

;-]... Quack Waddle
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-12 : 08:04:17
> image datatype is specifically for images

acctually it's for storing raw bytes. the name is just a bit wacky.

and yes varbinary(max) is preffered.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

cas_o
Posting Yak Master

154 Posts

Posted - 2007-07-12 : 09:10:06
>acctually it's for storing raw bytes. the name is just a bit wacky.

Yeah I didn't word my post very well, it was created with images in mind, but gets used for just about anything other than images.

;-]... Quack Waddle
Go to Top of Page

sfortner
Yak Posting Veteran

63 Posts

Posted - 2007-07-12 : 11:44:59
I've always read don't store images, but instead store references to the path. We stored serialized (binary) data using ntext, but when it gets big, it's really hard to script and have it run fast. I think there's something about the sqlcmd or osql parser that doesn't handle long lines very well. So we ended up pulling it out of the db, and just calling it from a location stored in the db, and now I'm much happier. In our case, we had to convert the serialized data with a 64 bit encoder in C#, store it, then decode it once you retrieved the data. Once the data was in there, seemed that it wasn't slow though, but file I/O on the application side is faster. The 64 bit encoder also wrapped the data so it was about 10 - 20% larger too, which didn't help.

--Steve
Go to Top of Page
   

- Advertisement -