varchar or nvarchar

后端 未结 9 1805
走了就别回头了
走了就别回头了 2021-02-19 13:54

I am storing first name and last name with up to 30 characters each. Which is better varchar or nvarchar.

I have read that nvarchar

9条回答
  •  被撕碎了的回忆
    2021-02-19 14:35

    varchar is 1 byte per character, nvarchar is 2 bytes per character.

    You will use more space with nvarchar but there are many more allowable characters. The extra space is negligible, but you may miss those extra characters in the future. Even if you don't expect to require internationalization, people will often have non-English characters (e.g. é, ñ or ö) in their names.

    I would suggest you use nvarchar.

提交回复
热议问题