[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

maximum row size exceeds the maximum number of bytes

Posted on 2004-03-26
5
Medium Priority
?
1,180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 14

Assisted Solution

by:Thandava Vallepalli
Thandava Vallepalli earned 400 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 600 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

656 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