Binary strings#
Fixed-length (binary) or variable-length (varbinary) binary data; image is the legacy
large-object variant.
binary
varbinary
image
binary and varbinary#
Binary data types of either fixed length or variable length.
binary [ ( n ) ] Fixed-length binary data with a length of n bytes, where n is a value from 1 through 8,000. The storage size is n bytes.
varbinary [ ( n | max ) ] Variable-length binary data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of the data entered + 2 bytes; the data entered can be 0 bytes in length.
Example:
SELECT CAST( 123456 AS BINARY(4) );
image#
Variable-length binary data from 0 through 2^31-1 (2,147,483,647) bytes.