Char data type used fixed size while var char data type used variable length.
Char maximum length is 255.
Char is used for fixed length values. char(10) means that maximum 10 number of character allowed and each value will require minimum 10 characters even for null value.
While varchar datatype used for variable length values. varchar maximum length is 65,535. if varchar(150) is declared and value need 10 character to store data, only 10 character plus 1 or 2 bytes store in value not 150 characters.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment