Binary Data Compatibility

The treatment of trailing zeros in binary data differs between Sybase IQ, SQL Anywhere, and Adaptive Server Enterprise.

Treatment of trailing zeros

Data type

Sybase IQ

SQL Anywhere

Adaptive Server Enterprise

BINARY NOT NULL

Padded

Not padded

Padded

BINARY NULL

Padded

Not padded

Not padded

VARBINARY NOT NULL

Truncated, not padded

Truncated, not padded

Truncated, not padded

VARBINARY NULL

Truncated, not padded

Truncated, not padded

Truncated, not padded

Adaptive Server Enterprise, SQL Anywhere, and Sybase IQ all support the STRING_RTRUNCATION database option, which affects error message reporting when an INSERT or UPDATE string is truncated. For Transact-SQL compatible string comparisons, set the STRING_RTRUNCATION option to the same value in both databases.

You can also set the STRING_RTRUNCATION option ON when loading data into a table, to alert you that the data is too large to load into the field. The default value is ON.

Bit operations on binary type data are not supported by Adaptive Server Enterprise. SQL Anywhere only supports bit operations against the first four bytes of binary type data. Sybase IQ supports bit operations against the first eight bytes of binary type data.