Difference between different string types in SQL Server?

前端 未结 9 1514
情书的邮戳
情书的邮戳 2020-12-29 04:22

What is the difference between char, nchar, ntext, nvarchar, text and varchar in SQL?

I

9条回答
  •  佛祖请我去吃肉
    2020-12-29 04:45

    • 'n' represents support for unicode characters.
    • char - specifies string with fixed length storage. Space allocated with or without data present.
    • varchar - Varying length storage. Space is allocated as much as length of data in column.
    • text - To store huge data. The space allocated is 16 bytes for column storage.

    Additionally - text and ntext have been deprecated for varchar(max) and nvarchar(max)

提交回复
热议问题