We receive the below warning message in SQL Server (2008 R2) when we try to add the new columns. The present, following are the column counts in each of the 3 tables that are reporting this warning message:
PSA_1 table has 260 columns; PSSA_1 table has 341 columns; PORS_1 table has 320 columns - These columns are mostly varchar(255) and a few int.
Message
Warning: The table "PSA_1" 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.
Warning: The table "PSSA_1" 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
Warning: The table "PORS_1" 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.
I have read the articles on msdn, but I want to confirm this for sure. Please confirm if the following understanding is correct:
SQL Server has a maximum row size of 8060 bytes (excluding large objects like text, ntext, image, varchar(max) and nvarchar(max)).
It will let you create tables where the theoretical maximum number of bytes is greater than that, but will give you the warning you're seeing.
This means is that if you try to populate each column in that table with the largest sized data values for each data type, you won't be able to execute the INSERT or UPDATE statement. However, as long as the total length of data you're trying to insert or update is less than 8060, you will be able to add and edit rows in the table.If you are sure your insert and update values won't exceed the 8060 limit. It's OK to ignore the warning
Question:
Does it not matter with SQL Server 2008 as long as the maximum row size is less than 8060 bytes (excluding the varchar(max)) columns? And we can safely ignore the warning.
E.g. I can have 1000 varchar (255) columns and 50 int columns in the table? While SQL Server would warn me, the insert/update would not fail?