Results 1 to 5 of 5

Thread: Constraints

  1. #1
    Join Date
    Feb 2004
    Posts
    64

    Post Constraints

    When I try to create constraint I get Warning: The table has been created but its maximum row size (15719) 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.

    what is this mean?

    Thanks in advance.

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    It means you have created a table with structure which looks likes it can hold 15719 bytes in a row but SQL Server can actually store 8060 bytes.

    example:
    use tempdb

    create table x1(lname varchar(8000), fname varchar(8000))

    output:
    Warning: The table 'x1' has been created but its maximum row size (16025) 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.

    insert into x1 select 'MAK','MAK'
    Output: This row used only 6 bytes
    (1 row(s) affected)

    If I insert

    this insert statement will fail
    insert into x1 select 'MAK........8000 bytes','MAK......61bytes'

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    From BOL....


    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.

  4. #4
    Join Date
    Feb 2004
    Posts
    64
    Thanks MAK. Yes we have column in that table varchar 8000. So its giving the warning when we are trying to alter the table.

    Do you know if I change datatype to text to store data unlimited in that column whether it will be issue in replication? Since this is distribution database.

  5. #5
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    a. Distribution databases are created by SQL Server for replication purposes.

    why you are adding a contraint to a table that exist in distribution database?

    Regarding Text data type please read this.

    http://msdn.microsoft.com/library/de...lplan_1l4e.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •