Question

When I create a new VARCHAR column in Microsoft SQL Server Manager Studio, it defaults to 50 length. Does this length have some special meaning? If theoretically I have the option to choose for a length between 30 and 70, is isn't it better to go for defaults that are power of 2 (like 32, or 64 in this case)?

Was it helpful?

Solution

Because its a nice small round number... Seriously I would think that its pretty arbitrary decision that was made.

OTHER TIPS

Powers of 2 are meaningless when it comes to the possible lengths of strings.

It's more efficient if string datatypes of fewer than 50 characters are declared as CHAR() rather than VARCHAR()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top