Possible Duplicate:
What is the difference between nchar(10) and varchar(10) in MSSQL?
Can anyone explain the difference between char, nchar, varchar, and nvarchar?
Char is fixed length.
Varchar is variable length, up to the specified length, which will save space.
N denotes Unicode capable types.
Just to add one more explanation you can also use nvarchar(max) and varchar(max). These are variable length fields that can store large amounts of data and are the replacement for the text and ntext datatypes which are deprecated. Do not use the nvarchar(max) orvarchar(max) for evey string field though to avopid having to figure out how big the field should be as they have indexing issues.
the nchar and nvarcar supports Unicode
Nchar(50) or char(50) will always occupy same space irrespective of the size of data.
Nvarchar(50) can store maximum 50 characters but the actual size depends on the data that is stored meaning its flexible , so if the input was 20 characters you can still use the rest elsewhere
精彩评论