char type: the English (ASCII) characters take up one byte, a character takes 2 bytes, CHAR stores fixed-length data is very convenient, CHAR field of high-level index of efficiency, such as the definition of char (10), then Whether you store data on whether the 10 bytes to 10 bytes to be accounted for in the space. Because it is a fixed length, so the speed and high efficiency.
Varchar Type: Varchar type does not fill a space, such as varchar (100), but its value is "qian", then its value is "qian"
But not the same as char, such as char (100), its value is "qian", but in fact it is in the database "qian" (qian after a total of 96 spaces, is to fill it to 100 bytes) .
Since char is fixed length, so its speed is much faster than varchar! Up to trouble, but procedures that use functions like trim on both sides of the space to get rid of!
VARCHAR store variable-length data, but there is no CHAR high storage efficiency. If the value of a field may not be a fixed length, we only know that it can not be more than 10 characters, it is defined as VARCHAR (10) is the best buy. The actual length of the VARCHAR type is the actual length of its value +1. Why is "+1" mean? This is a byte used to store the length of how much actual use.
Nchar Nvarchar type and how it all about? In order to convert with a variety of other characters, such as Chinese, phonetic symbols and so on, each in English (ASCII) characters take up 2 bytes, can occupy a two-byte characters, all characters occupy 2 bytes.