c# - Store unknown size data to table -
i realise there have been debates this, although can find real definitive answer.
a lot of times, question leads definition of varchar(max) etc is, actual limits, , not use.
what want find out this:
giving user option type/paste in whatever want in text box, without limit.
word, byte array dump of image.
i need able reference data @ later stage, using title or id.
what best way go storing data db? have read using varchar(max) stops indexing, , should not used.
i'm not well-off in sql, imagine possible solution split string arrays of 4000, , store them that.
is lead? or missing obvious?
general model:
public string a_title { get; set; } public string a_content { get; set; } public string a_additionalinfo { get; set; }
where a_content stored unknown.
varchar(max)
intended cases yours.
even if chunk data nvarchar(4000)
(or varchar(8000)
) byte segments allow indexes built, worth indexes have?
you'll opening headache of figuring out segments begin , end , reconstituting them either in nasty sql statement or in middle-tier client code.
further, varchar(max)
, nvarchar(max)
kept in-row when possible so. means until using 4001
or 8001
characters, respectively.
Comments
Post a Comment