I have a table i开发者_Python百科n SQL server 2008 R2 where I am storing values of translations. The translated values can be a text or it can be an image also. We want to use same column for storing the image and text so when we do a search we don't have to give 2 queries based on type of data. my question:- 1. Can I store image and text in the same column? 2. should I do that? or should i have 2 different columns? (one with varbinary and other simple nvarchar)?
As to 1 - you can... just use a varbinary and handle everything else on the client side...
As to 2 - you SHOULD NOT use 1 column for both... but 2 columns (one varchar, one varbinary) !
精彩评论