char , varchar , nchar , nvarchar are actually strings
size helps determine how long the string ...
by the way
char has a fixed length, so if you want to have "1" in char(2) , the content will be actual "1 "
varchar(2) will be "1"
part of n stands for unicode, so everything inside these fields will be in Unicode.
usually we use nvarchar to save some space in the data, as if you have char(250) , the database will always keep the full length, since empty varchar(250) will not be anything.
In our programming language, we use add-ons to do what char does, for example, in C #
"1".PadLeft(2); "1".PadRight(2);
outputs " 1" and "1 " respectively.
source share