If I encrypt a 50-character password in a VARBINARY(8000)
field, does it occupy some extra space when being 8000 length? Or is it how VARCHAR
?
If I encrypt a 50-character password in a VARBINARY(8000)
field, does it occupy some extra space when being 8000 length? Or is it how VARCHAR
?
The data type VARBINARY(N)
or VARBINARY(8000)
is equivalent to 8 Kilobytes, so it would not occupy extra space, the VARBINARY(MAX)
that retains information of up to 2,000,000,000 bytes which is the equivalent of 2 GB.
So by default the space used is 8 kilobytes.
Acts as a VARCHAR
, if the length of your field is going to be varying it is recommended that you use VARBINARY
otherwise you would use BINARY
Source: link