问一个关于Sybase页大小的问题
JsLyn 2017-03-13 11:13:18 Table 8-4: Maximum size for variable-length columns in an APL table
----------------------------------------------------------------------------------------------------------------
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).
上面表是官网关于页大小的描述
当安装是页大小设置为2K时,每行数据最大值是1962,每个字段最大值1948
为什么我在测试时
create table test ( v1 int, v2 varchar(2000), v3 varchar(2000) )
insert into table test values (1, '............abc', 'abc')
当v2的值长度是1940时报错:Attempt to update or insert row failed because resultant row of size 1965 bytes is larger than the maximum size (1962 bytes) allowed for this table
实际values后面值加起来长度只有1947位吧