Why does VARCHAR need length specification?

The “length” of the VARCHAR is not the length of the contents, it is the maximum length of the contents.

The max length of a VARCHAR is not dynamic, it is fixed and therefore has to be specified.

If you don’t want to define a maximum size for it then use VARCHAR(MAX).

Leave a Comment