CHAR(10)
will be padded to the defined length with spaces, e.g. if you have CHAR(10)
and store "Stack" in it, the contents will really be "Stack.....". Works great for things like state abbreviation (always 2 chars). But the padding does make the querying a bit more cumbersome at time.
VARCHAR(10)
will store as many chars as needed - more efficient, but more so for larger strings.
NVARCHAR(10)
will be the same - variable length - but with 2 bytes for each character (and NCHAR(10)
is the same as CHAR(10)
- only 2 bytes per character). Great for when you need to regularly support e.g. Asian, Cyrillic, or Arabic characters or other "non-Latin" alphabets. If you have Western European languages only (English, French, German, Spanish etc.), it's a waste of space.
My gut feeling tells me that CHAR/NCHAR
might be a tad quicker when joining, but I don't think it'll really be a significant difference. Otherwise, if you have to reserve 10 characters for each entry, and most of them are only 2 to 5 chars, you are wasting some space, so that's a downside for the CHAR/NCHAR
types.
So if I had to decide, I'd probably use VARCHAR(10)
(without knowing all your detailed requirements, that is).