Rows that exceed the maximum number of bytes will

  • Hi,

    When i was creating a table i got the following error:

    "The total row size (36506) for table 'online_ulist' exceeds the maximum number of bytes per row (8060). Rows that exceed the maximum number of bytes will not be added."

    Can someone explain what this means?

    I think it will not accept any rows having more than 8060 bytes. Is it right?

    If yes then its a problem as my rows do contain few fields where lot of data is inputted.

    Please advise a solution.

    Thanks and regards

    Hitendra

  • Rows in SQL Server can never contain more than 8060 bytes (even slightly less in some cases). This means that if you have multiple columns with a definition such as varchar(8000), then the total amount of bytes in these columns (and others for the row of course) can not exceed 8060. It is OK to enter 8000 characters into one column, just as long as the other columns of the row don't use more than 60 bytes.

    If you need more than this, then you should either use the datatype text, or redesign your tables and store these varchar-columns in a separate table.

    --

    Chris Hedgate @ Apptus Technologies (http://www.apptus.se)

    http://www.sql.nu

  • Actually you can create a table with multiple variable length columns that will cause a potentil width greater than 8060, but the data in the row will only go to the 8060 marker and drop the rest. I saw an instance some months back where someone had 2 varchar columns of 4000 on a table which together would have pushed the enter row to around 10000 with the other columns. However only one or the other column would be filled per row so the data was always there and one or the other was NULL. I asked about this and the guy stated their business case (which didn't make sense) but it was their DB not mine.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply