If I have a VARCHAR of 200 characters and that I put a string of 100 characters, will it use 200 bytes or it will just use the actual size of the string?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
100 characters.
This is the var (variable) in
varchar: you only store what you enter (and an extra 2 bytes to store length upto 65535)If it was
char(200)then you’d always store 200 characters, padded with 100 spacesSee the docs: “The CHAR and VARCHAR Types”