What's the difference between: char nchar varchar nvarchar
- char and varchar are both character data types.
- The difference is that char is fixed length and varchar is variable length.
- Use char when the sizes of the column data entries are consistent or similar, for example, city code or phone number.
- Use varchar when the sizes of the column data entries vary considerably, e.g. shipping addresses, URL, so that a shorter value takes less space than a longer one.
- nchar and nvarchar are similar to char and varchar, but they are used to store Unicode data (using the UNICODE UCS-2 character set)
No comments:
Post a Comment