nvarchar vs varchar
-
Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!
-
Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!
Nvarchar stores unicode characters which means you don't have the problem with different codepages in different countries. But it also uses twice the space. If you need to store characters from several alphabets in the same field you really will like nvarchar.
"When did ignorance become a point of view" - Dilbert
-
Nvarchar stores unicode characters which means you don't have the problem with different codepages in different countries. But it also uses twice the space. If you need to store characters from several alphabets in the same field you really will like nvarchar.
"When did ignorance become a point of view" - Dilbert
multi language benefit, but space cost...got it, thanks!
-
multi language benefit, but space cost...got it, thanks!
Heres another one, SQL Server CE ONLY supports nvarchar, nchar etc so if you need to use CE then you know the requirement. Also does not support stored procedures X| I am currently bleeding from this particular bite me!
Never underestimate the power of human stupidity RAH
-
Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!
VARCHAR is a variable length string of ASCII characters while NVARCHAR is a variable length string of UNICODE characters.Since NVARCHAR can handle unicode characters, so it allows to use multiple languages in the database. Each ASCII character takes one Byte of space while each UNICODE character takes two Bytes of space. It means NVARCHAR takes twice as much space to store to allow for the extended character set required by some other languages.