Difference between different string types in SQL Server?

前端 未结 9 1496
情书的邮戳
情书的邮戳 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:44

    Text is meant for very large amounts of text, and is in general not meant to be searchable (but can be in some circumstances. It will be slow anyway).

    The char/nchar datatypes are of fixed lenghts, and are padded if entered stuff is shorter, as opposed to the varchar/nvarchar types, which are variable length.

    The n types have unicode support, where the non-n types don't.

提交回复
热议问题