BINARY and VARBINARY

suggest change

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 bytes. max indicates that the maximum storage space is 2^31-1.

Examples:

SELECT CAST(12345 AS BINARY(10)) -- 0x00000000000000003039
SELECT CAST(12345 AS VARBINARY(10)) -- 0x00003039

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Data Types:
*BINARY and VARBINARY

Table Of Contents