In my SP, I need to work with a string that can contain up to 40 characters.
Will it make a difference if I use VARCHAR(4000)instead VARCHAR(40)?
Update:
The reason why I ask this question lies in the fact that, as far as I know, the memory usage of the variable VARCHAR(4000)and VARCHAR(40)the same. I am trying to understand why I should limit myself to a variable VARCHAR(40)? Why not VARCHAR(4000)? Is it because performance or memory efficiency?
Update 2, Important Assumption:
I assume that when we store the string "Hello World" in a variable of any type VARCHAR(4000)or VARCHAR(40), it takes the same amount of memory. I'm right?
source
share