?
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
Medium Priority
?
398 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
[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
5 Comments
 
LVL 6

Accepted Solution

by:
acampoma earned 500 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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 setup several different housekeeping processes for a SQL Server.
Suggested Courses

764 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