SQL INSERTION issue

  • Error:max row size can not be more than 8060 characters in Sql-server2000

    create table abc (Col1 varchar(8000), col2 varchar(8000))

    insert abc values (replicate('a',4000), replicate('a',4000))

    i have sql 2000 enterprise edition with SP1

    can any one help me?

  • Hi,

    Refer BOL: http://msdn.microsoft.com/en-us/library/aa258255(SQL.80).aspx

    Remarks

    SQL Server can have as many as two billion tables per database and 1,024 columns per table. The number of rows and total size of the table are limited only by the available storage. The maximum number of bytes per row is 8,060. If you create tables with varchar, nvarchar, or varbinary columns in which the total defined width exceeds 8,060 bytes, the table is created, but a warning message appears. Trying to insert more than 8,060 bytes into such a row or to update a row so that its total row size exceeds 8,060 produces an error message and the statement fails.

    CREATE TABLE statements that include a sql_variant column can generate the following warning:

    The total row size (xx) for table 'yy' exceeds the maximum number of bytes per row (8060). Rows that exceed the maximum number of bytes will not be added.

    This warning occurs because sql_variant can have a maximum length of 8016 bytes. When a sql_variant column contains values close to the maximum length, it can overshoot the row's maximum size limit.

    Each table can contain a...

    It’s not the error, it’s the warning. Suppose, each row bytes exceed the limit of the 8060 the update/inserts goes fail.

    Manage up to 8060 bytes in each row, then not the issue. like

    Insert #abc values (replicate('a',4000), replicate('a',4000))But When insert like the below

    insert #abc values (replicate('a',4000), replicate('a',4100))

    you see the fail error.

Viewing 2 posts - 1 through 1 (of 1 total)

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