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
375 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

914 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

18 Experts available now in Live!

Get 1:1 Help Now