APL tables that contain one variable-length column (for example, varchar, varbinary and so on) have the following minimum overhead for each row:
Two bytes for the initial row overhead.
Two bytes for the row length.
Two bytes for the column-offset table at the end of the row. This is always n+1 bytes, where n is the number of variable-length columns in the row.
A single-column table has an overhead of at least six bytes, plus additional overhead for the adjust table. The maximum column size, after all the overhead is taken into consideration, is less than or equal to the column length + number of bytes for adjust table + six-byte overhead.
Page size |
Maximum row length |
Maximum column length |
---|---|---|
2K (2048 bytes) |
1962 |
1948 |
4K (4096 bytes) |
4010 |
3988 |
8K (8192 bytes) |
8096 |
8058 |
16K (16384 bytes) |
16298 |
16228 |
If your table uses 2K logical pages, you can create some variable-length columns whose total row-length exceeds the maximum row-length for a 2K page size. This allows you to create tables where some, but not all, variable-length columns contain the maximum possible size. However, when you issue create table, you receive a warning message that says the resulting row size may exceed the maximum possible row size, and cause a future insert or update to fail.
For example, if you create a table that uses a 2K page size, and contains a variable-length column with a length of 1975 bytes, Adaptive Server creates the table but issues a warning message. However, an insert fails if you attempt to insert data that exceeds the maximum length of the row (1962 bytes).