Binary datatypes store raw binary data, such as pictures, in a hexadecimal-like notation.
Binary data begins with the characters “0x” and includes any combination of digits and the uppercase and lowercase letters A – F. The two digits following “0x” in binary and varbinary data indicate the type of number: “00” represents a positive number and “01” represents a negative number.
If the input value does not include “0x,” SAP ASE assumes that the value is an ASCII value and converts it.
Use the fixed-length binary type, binary(n), for data in which all entries are expected to have a similar length. Because entries in binary columns are zero-padded to the column length, they may require more storage space than those in varbinary columns, but they are accessed somewhat faster.
Use the variable-length binary type, varbinary(n), for data that is expected to vary greatly in length. Storage size is the actual size of the data values entered, not the column length. Trailing zeros are truncated.
When you create a binary column that allows nulls, SAP ASE converts it to a varbinary column and uses the storage rules for that datatype.
You can search binary strings with the like keyword and operate on them with the string functions.