Wide column and data truncation

Earlier versions of Adaptive Server had a column-length limit of 255 bytes. Version 12.5 allows you to create columns using char, varchar, binary, and varbinary datatypes that can be up to 16294 bytes long, depending on the logical page size your server uses. Because of this, data that was truncated at 255 character in earlier versions is no longer truncated. If your application depended on this truncation, the result set it receives may no longer be accurate. In the following example, col1 and col2 are each 200 characters long, and col3 is 255 characters long:

select * from t1 where col1 + col2 = col3

If col1 and col2 each hold 200 characters, their concatenation results in a 400-character string. Earlier versions truncate this to 255 characters, and the sum of col1 and col2 may have matched col3. However, for version 12.5, the product of col1 and col2 is 400 characters, and will never match a col3 that is 255 characters long.

Character and binary expressions can produce a result that up to 16384 bytes long. Data that is longer that this is truncated.