question

mariwan avatar image
mariwan asked

What are the differences between nchar and char?

What's the difference between nchar and char?

sql-server-2005unicode
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

graz avatar image
graz answered

CHAR uses one byte to store each character and NCHAR uses two bytes to store each character.

CHAR uses ASCII to represent its characters and is commonly used for English applications. ASCII also supports a very small set of non-Enlish characters. NCHAR uses UNICODE to represent its characters using two bytes each. UNICODE is commonly used to non-Enlish text.

Knowing this NCHAR takes twice as much storage space as CHAR on a per-letter basis. However if you need international characters NCHAR is probably your only choice.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Håkan Winther avatar image
Håkan Winther answered

nchar is unicode while char is not

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Madhivanan avatar image
Madhivanan answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.