I would like to create table to storage short text. What is the best type to use.
char varchar
but i can't guarantee the text length. Any best practice ?
I would like to create table to storage short text. What is the best type to use.
char varchar
but i can't guarantee the text length. Any best practice ?
VARCHAR
is the newer-style storage type for strings. Speaking from a MSSQL pov, VARCHAR
offers many benefits over CHAR
such as dynamic sizing, off-row storage for large values etc. I'd go with VARCHAR every time - unless I knew that the text was always going to be a fixed size.
If you are not sure about text length then i will suggest you should go with varchar.
you can just check,