SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Maximum row size in SQL Server 2000.


Maximum row size in SQL Server 2000.

Author
Message
Joy Smith San
Joy Smith San
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3244 Visits: 3200
Dear All,

I do work in SQL server 2005.

Today I happen to add a table in SQL Server 2000 for one of my collegue. In query analyzer, I was trying to create a table with 7 fields out of which 2 fields are of VARCHAR(8000). Even though table got created it gave a warning, saying "IT EXCEEDS THE MAXIMUM ROW SIZE OF 8061" bytes.

I need to add about 8000 char long values in 2 of the fields.
So what should I do.? Do I need to select the datatype as TEXT or any other datatype for those columns..?

Please help.

I get this warning only in Query Analyzer. Using enterprize manager table gets created without any warning or error...

I have never faced this problem in SQL2K5 while creating tables.But this limitation is there for Indexes and I could use INCLUDE key word for that.

Thanks.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)

Group: General Forum Members
Points: 88182 Visits: 45277
Enterprise manager's just hiding the warnings. The max size for a row is 8060 bytes. You can create the table, but should any insert try and add more than 8060 bytes to the row, the insert will fail.

If you need that much space, you'll have to use TEXT columns.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


GSquared
GSquared
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23741 Visits: 9730
Text data-type is one way to go on that. The other is to vertically partition the table.

If, for example, the table has an ID column, then you have the "main table" with the ID and all the columns except the two varchar(8000) columns, then you have two other tables, each has just the ID and one of the varchar(8000) columns. The other two have FK with cascading delete to the main table.

Makes inserts and updates a little more complicated, but allows you to have the data the way you need.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Joy Smith San
Joy Smith San
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3244 Visits: 3200
Thank you Gails & GSquared.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search