Last post Oct 08, 2015 08:12 AM by wim sturkenboom
Oct 08, 2015 02:40 AM|ts-alan1|LINK
This question http://stackoverflow.com/questions/144283/what-is-the-difference-between-varchar-and-nvarchar has an
Jeffrey L Whitledge's answer
By using nvarchar rather than varchar, you can avoid doing encoding conversions every time you read from or write to the database. Conversions take time, and are prone to errors. And recovery from conversion errors is a non-trivial problem
I can not understand it.
Nvachar have conversion is Unicode and it will also take time.
Oct 08, 2015 06:27 AM|wmec|LINK
I think the main point of the link is just
varchar: Variable-length, non-Unicode character data. The database collation determines which code page the data is stored using.
nvarchar: Variable-length Unicode character data. Dependent on the database collation for comparisons.
Oct 08, 2015 06:32 AM|wmec|LINK
and you no need to care about if there is any conversion being done.
Oct 08, 2015 08:12 AM|wim sturkenboom|LINK
You left a very important part out of the specific reply.
All modern operating systems and development platforms use Unicode internally. By using
nvarchar rather than varchar, you can avoid doing encoding conversions every time you read from or write to the database. Conversions take time, and are prone to errors. And recovery from conversion errors is a non-trivial problem.
Also, from the reply
With cheap disk and memory nowadays, there is really no reason to waste time mucking around with code pages anymore.
Now cheap is obviously relative but the general thinking nowadays is that if you don't have enough HD space, you just add a few terabytes of diskspace and if you don't have enough memory, you just double or quadruple the amount of memory as it costs nothing.
I once walked out of a meeting as I totally don't agree with that mentality; but I grew up coding for systems where 4kB code memory and 256Bytes were the limit so I'm probably biased. Every coding decision was finding a balance between performance and space.