BINARY and VARBINARY
suggest changeIn SQL Server, these are binary data types of either fixed length or variable length.
Syntax:
BINARY [ ( n_bytes ) ]
VARBINARY [ ( n_bytes | max ) ]
n_bytes can be any number from 1 to 8000. max indicates that the maximum storage space is 2^31−1 bytes.
Examples:
SELECT CAST(12345 AS BINARY(10)) -- 0x00000000000000003039
SELECT CAST(12345 AS VARBINARY(10)) -- 0x00003039
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents