Assigning an empty binary value to a varbinary (MAX) column creates an 8000 byte column

I have a table with a varbinary (max) column, I try to assign a zero binary buffer to this column, but instead of getting a value of zero length in the table, I get 8000 bytes a value filled with zeros:
8000 long zero buffer
* the dataSize column in the shown query was added with using DATALENGHT (data) ("SELECT _index, dataSize = DATALENGHT (data) , FROM data ....") and shows the actual size of the table value

Where does the empty 8,000 byte buffer come from? is this some kind of default behavior?

+3
source share
1 answer

(8000), DATALENGTH(data) 8000 ( ), 8000 .

SELECT _index, dataSize=DATALENGTH(data), data FROM

(8000) - . , BINARY(8000) .

0

Source: https://habr.com/ru/post/1792530/


All Articles