Solved

Warning: The table 'tblAlbums' has been created but its maximum row size (14625) exceeds the maximum number of bytes per row (8060).

Posted on 2004-08-24
5
374 Views
Last Modified: 2007-12-19
What does the following warning mean:

"Warning: The table 'tblAlbums' has been created but its maximum row size (14625) 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."


The table structure is as follows:


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblAlbums]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblAlbums]
GO

CREATE TABLE [dbo].[tblAlbums] (
      [id] [int] IDENTITY (1, 1) NOT NULL ,
      [publishDate] [smalldatetime] NOT NULL ,
      [releaseDate] [smalldatetime] NOT NULL ,
      [albumType] [int] NOT NULL ,
      [title] [varchar] (75) COLLATE Latin1_General_CI_AS NOT NULL ,
      [shortDescription] [varchar] (500) COLLATE Latin1_General_CI_AS NOT NULL ,
      [description] [varchar] (7000) COLLATE Latin1_General_CI_AS NOT NULL ,
      [session] [varchar] (7000) COLLATE Latin1_General_CI_AS NOT NULL ,
      [price] [smallmoney] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblAlbums] WITH NOCHECK ADD
      CONSTRAINT [PK_tblAlbums] PRIMARY KEY  CLUSTERED
      (
            [id]
      )  ON [PRIMARY]
GO

ALTER TABLE [dbo].[tblAlbums] ADD
      CONSTRAINT [DF_tblAlbums_publishDate] DEFAULT (getdate()) FOR [publishDate],
      CONSTRAINT [DF_tblAlbums_releaseDate] DEFAULT (getdate() + 1) FOR [releaseDate]
GO

0
Comment
Question by:smacca
5 Comments
 
LVL 6

Accepted Solution

by:
acampoma earned 125 total points
ID: 11889022
The sum of the size of all your columns is too large,
ou should probably use the text data type
0
 
LVL 34

Expert Comment

by:arbert
ID: 11889094
Like acampoma said above, your total row size is too large.  However, I wouldn't recommend anyone use the text type unless they have too.  It just gets too difficult later if you need to search/replace items in the column, do sort, group bys, etc....


Are you sure you need to varchar(7000) columns in the row?  What's the session column for?
0
 
LVL 6

Expert Comment

by:robertjbarker
ID: 11889513
One solution to keeping the varchar type and both description and session columns would be to create another table:

CREATE TABLE [dbo].[tblAlbumsSession] (
     [id] [int]  NOT NULL ,
     [session] [varchar] (7000) COLLATE Latin1_General_CI_AS NOT NULL ,
  )

and take [session] out of [tblAlbums].

The [tblAlbumsSession].[id] value would have to match the one for the corresponding row in [tblAlbums]
0
 
LVL 18

Expert Comment

by:ShogunWade
ID: 11890360
Agree with arbert.   Review your table definition.
0
 

Author Comment

by:smacca
ID: 11898611
Thanks all for you participation!
RoberJBarker: The solution looks good but I only wanted to know reason - thanks heaps regardless!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now