What is the best data type to store pictures and text together? in ms sql

What is the best data type to store pictures and text together? in ms sql
goodkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Please define "pictures and text together".
0
goodkAuthor Commented:
like an article with pictures and text
0
Walter RitzelSenior Software EngineerCommented:
Usually, we use BLOB or CLOB. and their variations LONGBLOB OR LONGCLOB.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Duy PhamFreelance IT ConsultantCommented:
Pictures and text are not the same type, so you firstly have to convert them into the same type (either as binary or as text). And then you can use IMAGE, BINARY, VARBINARY or TEXT, NTEXT, VARCHAR, NVARCHAR to store the converted data.

However, I don't recommend this because it requires a lot of overhead in effort of data conversion when putting into database or getting them out. Proper way could be that you store pictures and text in different tables and then make links between them in order to process pictures and text together later.
0
Scott PletcherSenior DBACommented:
I believe you have to use varbinary(max) for that, even though it doesn't recognize text as characters when stored that way.  But no character-type column would be able to hold the picture.
0
Walter RitzelSenior Software EngineerCommented:
Just an article to reinforce what was said:
http://sqlmag.com/t-sql/dont-be-afraid-blobs-and-clobs
0
ste5anSenior DeveloperCommented:
Go for DocumentDB..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
goodkAuthor Commented:
thank you guys
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.