Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 nvarchar and varchar

Author  Topic 

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2002-03-06 : 09:13:12
I guess I've really never understood the difference between the 2 except for that nvarchar has 4000 and varchar can have 8000 charactors. Other than size, is there some reason I should be choosing 1 over the other?

Daniel
SQL Server DBA

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-03-06 : 09:23:35
The national character set allows you to store all characters in any language (Hebrew, Arabic, Japanese, Korean, some Chinese I think, and the Roman alphabet), so if you've got a multi-lingual database application you don't have to have multiple copies of the same database for each language, and you don't have to deal with code page translations.

Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-03-06 : 10:05:19
Given that UCS-2 can only represent codepoints in Unicode from 0000-FFFF, and Unicode defines (as of version 3.1) codepoints above this, it will be interesting to see what the next version of SQL Server does -- will there be a new UCS-4 native char type too? Or will nvarchar be redefined as being stored as UTF-16 but with a UTF-32/UCS-4 interface? Or UTF-16 all the way through? (I'm not even sure what that would mean!)


Edited by - Arnold Fribble on 03/06/2002 10:31:57
Go to Top of Page
   

- Advertisement -