show_t
asked on
Cannot create a row of size 8142 which is greater than the allowable maximum of 8060
Hi,
I've got a table with 160 fields. They are all necessary. Problem is that every now and then i get an error message saying "Cannot create a row of size 8142 which is greater than the allowable maximum of 8060" when i try and save a record to the database.
Help
:-)
Thanks
I've got a table with 160 fields. They are all necessary. Problem is that every now and then i get an error message saying "Cannot create a row of size 8142 which is greater than the allowable maximum of 8060" when i try and save a record to the database.
Help
:-)
Thanks
Unfortunately, there is NO way to create a row longer than 8060 total bytes, and that length also includes many overhead bytes for SQL Server itself. That is the max available data bytes on a page, and SQL will NOT split one row across pages (it doesn't have the internal logic to allow it to do that).
You could try to reduce the total length of all columns by 82 bytes (or more). Or, you could create another table for 82+ bytes worth of the least frequently accessed columns and then join to that table when needed.
You could try to reduce the total length of all columns by 82 bytes (or more). Or, you could create another table for 82+ bytes worth of the least frequently accessed columns and then join to that table when needed.
You could also try converting a lengthy varchar column(s) to text, but that makes it much harder to use and manipulate the column, so that should be a last resort (text column use only 16 bytes of the main row -- the rest of the data is stored in separate pages).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you split the fields into a number of tables / normalise the database structure?
Cheers