When I create a new table with so many columns with nvarchar
type
create table testcolumnsize
(
a001 nvarchar(4000),
a002 nvarchar(4000),
--.....
a400 nvarchar(4000),
)
I received a warning message that told
Warning: The table "testcolumnsize" has been created, but its maximum row size exceeds the allowed maximum of 8060 bytes. INSERT or UPDATE to this table will fail if the resulting row exceeds the size limit
How can I calculate the created table's size according to it's columns data type to determinate whether it's size exceeds the allowed maximum of 8060 bytes
For example
create table testcolumnsize
(
cint int,
cbigint bigint,
cfloat float,
cdatetime datetime,
--.....
)