Reading this question, a doubt popped into my head:
- char and varchar can store up to 255 chars
- text can store up to 65k chars
- char size in bytes is number of chars
- varchar size in bytes is number of chars used + 1
So how much bytes does TEXT actually occupy? ~65KB or number of chars used + 1?
varchar size in bytes is number of chars used + 1This actually depends on the encoding used in the table. It could, for example, be((# of chars) * 2) + 1for 2-byte characters. Remember it's number of characters not number of bytes.