Is varchar(MAX) always preferable?

前端 未结 4 1366
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 08:05

Regarding SQL Server, I understand :

  • var means the memory is lazy allocated, meaning it fits to the data exactly (on insertion).

  • <
4条回答
  •  春和景丽
    2020-12-13 08:37

    Here's what microsoft recommends:

    • Use char when the sizes of the column data entries are consistent.
    • Use varchar when the sizes of the column data entries vary considerably.
    • Use varchar(max) when the sizes of the column data entries vary considerably, and the size might exceed 8,000 bytes.

    ref

提交回复
热议问题