SQL Server - Exceeds the maximum allowable table row size of 8060 bytes

In SQL Server, a table can contain a maximum of 8,060 bytes per row excluding VARCHAR, NVARCHAR, VARBINARY and some other variable length types.

For the example, the following CREATE TABLE statement fails:

SQL Server:

  CREATE TABLE items
  (
    c1 CHAR(2000),
    c2 CHAR(2000),
    c3 CHAR(2000),
    c4 CHAR(2000),
    c5 CHAR(2000)
  );
  # Msg 1701, Level 16, State 1, Line 1
  # Creating or altering table 'items' failed because the minimum row size would be 10007,
  # including 7 bytes of internal overhead. This exceeds the maximum allowable table row size of 8060 bytes.

But if you change at least one column to VARCHAR data type, the table can be created successfully:

SQL Server:

  CREATE TABLE items
  (
    c1 CHAR(2000),
    c2 CHAR(2000),
    c3 CHAR(2000),
    c4 CHAR(2000),
    c5 VARCHAR(2000)   -- Changed CHAR to VARCHAR
  );
  # Commands completed successfully.

SQLines Data

When you migrate a database that does not have this row limitation (Informix i.e.) to SQL Server SQLines Data tool offers -char_to_varchar_length option that allows you to automatically convert CHAR(n) columns starting from the specified length to VARCHAR(n).

For more information, see SQL Server Migration Reference.