I am experimenting with a possible data structure for an app of mine, and I need to provision a column in one of my SQL Server data tables to hold various data of unpredictable size.
Literally, this could mean a string of text, or a Base64 encoded video clip and everything in between.
I realize that the instant response is going to be that I should provision different tables for different types — and I don’t disagree — but please humor me here.
varchar(MAX)?
nvarchar(MAX)?
I am not a DBA so I don’t know what type gives me the most flexibility for the lowest storage cost.
VARBINARY(MAX)?
In principle, trying to force multiple different data types into a single type is a bad idea. You may be better served with a different table for each type. But if you’re never going to search the field, you should be able to do anything with a binary field…