Determining Nvarchar Length

I read all about varchar and nvarchar. But I did not see the answer to what I consider to be a simple question. How to determine the length of an nvarchar column? For varchar it is very simple: my description, for example, can contain 100 characters, so I define varchar (100). Now they tell me that we need to internationalize and support any language. Does this mean that I need to change the description column to nvarchar (200), i.e. Just double the length? (And I ignore all other issues related to internationalization at the moment.)

It's simple?

+7
sql sql-server nvarchar
source share
1 answer

In general, this is the same as for varchar . The number is still the maximum number of characters, not the length of the data.

nvarchar(100) allows you to use 100 characters (which could potentially consume 200 bytes in SQL Server).

You might want different cultures to accept more characters to express the same thing.

An exception to this is, however, if you use SC sorting (which supports extra characters ). In this case, one character can take up to 4 bytes.

In the worst case, it would double the declared value of the character.

+12
source share

All Articles