• Noel McKinney (6/5/2009)


    Respectfully disagree with the answer; I'd actually say varchar(1) is the worst choice. You've got the +2 byte overhead for allowing variable length when the question states the length will always be one, plus if you are going to waste space then use it on the possibility of needing to store Unicode characters. It seems there are two choices for "best" and that would be char(1) or nchar(1)... char(1) because it does the job with the least space unless you need Unicode, in which case nchar(1) is best.

    Very well said. There really isn't one "right" answer to this question, but char(1) and nchar(1) are the only "reasonable" answers. This question is a good example of how dangerous bad information can be. The author is under the misconception that the overhead for the varchar length is 1 byte rather than 2. This can make a big difference when determining space requirements for a table with several varchar columns and many rows.