Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In SQL Server specifically, does Varchar(50) take same amount of space as Varchar(MAX)?

For example, if I wanted to store a 20 byte character string, would a VARCHAR(50) field use the same space as a VARCHAR(MAX) field ?

like image 852
darsnet67 Avatar asked Sep 16 '25 20:09

darsnet67


1 Answers

Varchar(50) stores a maximum of 50 characters. Varchar(max) stores a maximum of 2,147,483,647 characters. But, varchar(50) keeps the 50 character space even if you don't store 50 characters. but varchar(max) is flexible to any size. size doesn't matter.

like image 193
devst3r Avatar answered Sep 18 '25 16:09

devst3r