APL tables that contain one variable-length column (for example, varchar, varbinary and so on) have the following minimum overhead for each row:
2 bytes for the initial row overhead.
2 bytes for the row length.
2 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 6 bytes, plus additional overhead. The maximum column size, after overhead, must be less than or equal to: (column length) + (additional overhead) + (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 |
8068 |
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. You cannot insert data that exceeds the maximum length of the row (1962 bytes).