row length exceeds 8060 bytes. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

row length exceeds 8060 bytes.


I get the error beolow when I’m creating a table (further below).
It’s referring to the varchar8000. Any ideas on how we should handle it?
Warning: The table ‘PartnerRejectionLog’ has been created but its maximum row size (9147) 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. CREATE TABLE [dbo].[RejectionLog] (
[LogID] [bigint] IDENTITY (1, 1) NOT NULL ,
[AffiliateID] [int] NULL ,
[FranchiseID] [int] NULL ,
[FirstName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[LastName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EmailAddress] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Make] [t_Make] NULL ,
[Model] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Year] [t_Year] NULL ,
[zip] [t_ZipCode] NULL ,
[AffiliateName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[XMLIn] [varchar] (8000) NULL ,
[RejectionReason] [nvarchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[DateRejected] [datetime] NOT NULL default getDate()
) ON [PRIMARY]
GO

It is just a warning. If you try to insert records that where rowsize exceeds 8060 bytes, you will get error otherwise no problem. Read about Maximum Capacity Specifications in sql server help file Madhivanan Failing to plan is Planning to fail
If XMLIn really needs to be that wide, you’ll get problems when INSERTing such a wide value into the column. You might want to change it to TEXT (or VARCHAR(MAX) in SQL Server 2005) or move that column into a seperated table with a 1:1 relation to RejectionLog. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
]]>