1 Table 1 Text, 1 Table 1 Text and 1 Varchar, or 2 Tables 1 Text 1 Varchar

I have an input field where 95% of the time, the submission will be below 100 characters. The other 5%, it will be over 256 characters. What’s the best way to store this data? It will always be one or the other, and I will either be looking at the small entries OR the big entries, never both at the same time.

I’m thinking its best to have a Text column and a Varchar column in the same table.

Would having an extra text column affect efficiency if it’s empty and the query doesn’t look at it? I could use scripting to look in a different table if it would be most efficient.

It would be easiest on the scripting end if everything was in one column, would making 1 Text column really kill efficiency if all the data I’m looking through is small?

Thanks,
e39m5

no

no

:cool:

Depends on what database–SQL Server treats TEXT* far, far differently than VARCHAR.

  • you should not use TEXT anymore if you are using Sql 2005 or better. VARCHAR(MAX) is vastly superior in every way.