database - Which SQL Server 2008 data type should be used for image and text data? -


i have table in sqlserver, , 1 of fields expecting rather mixed data; receive text value, let's sake of argument:

 ascii art picture of cat poorly spelt caption 

then contain actual jpeg contains images of cats poorly spelt captions. what's best datatype use in instance? big, long, object.

we can assume ascii art pictures small, 16 chars x 16 chars. store them in varchar(256) field, @ least if wasn't pesky big 2mb jpegs people send.

additional bit

semantically, can both of these images of cats, albeit in different formats. question guess i'm asking if there appropriate datatype handle values semantically same thing, come in different forms.

additional bit #2

in case, amount of data our cat varies wildly. cat caption image small, , need ~256bytes of information stored. large, if plaintext ascii cat image, might take ~256megabytes, can shove in jpeg , takes 2megabytes. yay, moar cat images can stored on our harddrive! naturally, not want convert ~256byte ascii images 2megabyte jpeg, because can't fit many pictures of cats on harddrive.

in case there's suggestion along these lines - can't make new format 2mb jpegs, output 2mb compatible legacy, third-party, closed source cat-caption generator. generates captions of such incredible awesomeness rewriting difficult task, , outside of scope of software being written.

nb: actual real life use case data coming off genetic analysis machine, if you're interested, i'd rather question more general use case of cat pictures. being internet , all.

additional bit #3

we can database structure looks bit like

mycatcontent     idcatcontent int not null auto_increment primary key,     catcontenttype int not null references catcontenttype (catcontenttype),     content {whatsortoffieldisthis?}  catcontenttype     catcontenttype int not null auto_increment primary key,     description varchar(20) not null 


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -