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

      Topic Next Topic 
  • If your row size is big, perhaps you might want to use TEXT data type. But there are some pay offs for using TEXT data type. Check out docs and understand the ramifications before you decide to change the data type.

    ******************
    Dinakar Nethi
    Life is short. Enjoy it.
    ******************

  • Two tables with a common key will be much much easier than a Text column... put the VARCHAR(8000) column in the second table along with the primary key of the original table.

    One might also ask, why are you using VARCHAR(8000)?  Would not VARCHAR(7000) do just as well?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • What is the purpose of having XML text INSIDE of relational database?

    Files must be stored (if required) in the place designed to store files - in file system.

    Database is designed to store DATA.

    XML is the data wrapped in some formatted way.

    If you need to read this data then read XML with appropriate service and store DATA IN THE DATABASE.

    If you don't need the data then store the file and keep the link to file location.

    Dont turn your database into waste-dump.

    _____________
    Code for TallyGenerator

  • I didn't read the column name... Serqiy is correct.  I don't allow folks at work to store XML in any database at anytime.  I make the rip it apart and store it as viable data.  It's like storing images in a db... not a good idea.  If you want, store the name of XML file instead of ripping it apart but don't store the actual XML in the database.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply