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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP installation issues 11 59
SQL LINE CONTINUATION ISSUE 12 31
Creating SQL script using SQL data and SQL script 8 33
SQL Server - Set Value of Multiple Fields in One Query 10 22
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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…
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

813 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

9 Experts available now in Live!

Get 1:1 Help Now