Solved

maximum row size exceeds the maximum number of bytes

Posted on 2004-03-26
5
1,125 Views
Last Modified: 2008-02-01
i built a data model in visio then generated the SQL Server database from this.  
One table "Return" has alot of columns in it - 71.  When i generated it i got this warning message

"Warning: The table 'Return' has been created but its maximum row size (14645) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
Warning: The table 'Return' has been created but its maximum row size (14645) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes."

what should i do?

thanks
0
Comment
Question by:cocosteel
  • 2
  • 2
5 Comments
 
LVL 14

Assisted Solution

by:Thandava Vallepalli
Thandava Vallepalli earned 100 total points
ID: 10686583
Hello,

Each row limit should not exceede 8060 bytes.  So the data size of the each row (i.e 71 columns data ) should not exceede 8060 bytes.  

For eg.  If you create below table

create table temptk
(
      temp1 varchar(8000),
      temp2 varchar(8000),
      temp3 varchar(8000)
)

Same warning you get. Because total size of 3 columns is 24000 bytes. It exceeds limit of 8060 bytes.

: Warning: The table 'temptk' has been created but its maximum row size (24027) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.

Now i modified my create table script.
drop table temptk
create table temptk
(
      temp1 varchar(3000),
      temp2 varchar(3000),
      temp3 varchar(2000)
)

Now it executes without any warinings.  Because total size of the 3 columns is 8000 bytes. its is less than 8060 bytes.

All the best,
V.Thandava Krishna.
0
 
LVL 13

Expert Comment

by:danblake
ID: 10686619
Split the table into two.

Reduce the number of columns in the a single table -- so the maximum number of bytes / table row < 8060.

Otherwise you run the risk of not being able to save your data ----

Have a look here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;260418


How to calculate row-size:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_92k3.asp
0
 
LVL 13

Accepted Solution

by:
danblake earned 150 total points
ID: 10686635
You can probably duplicate the PK across the two tables (a vertical partioned table)....

Table1
PKFields1   PKFields2  Field3 Field4 Field5

Table2
PKFields1  PKFields2  Field6 Field7 File8


Will probably be the easiest fix mechanism if you cannot reduce the length of the columns involved.
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 10686662
Hello,

If you don't want to decrese the columns size replace varchar with text.

create table temptk
(
      temp1 text,
      temp2 text,
      temp3 text
)

You need not specify the sizes here.

All the best,
V.Thandava Krishna.
0
 

Author Comment

by:cocosteel
ID: 10687646
thanks thats fixed it.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question