INSERT or UPDATE of a row in this table will fail

  • I am getting the following error on UPDATE of a Temporary table in a stored procedure. Table has about 12 fields which are varchar(3000). Is there a way around it or do I need to break it up into multiple tables.

    Message:

    'Warning: The table '#myReport' has been created but its maximum row size (36123) 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 problem is the maximum row length is > 8060. If someone filled out all the fields to their max length, you're talking 36000 bytes. I'd look at either splitting into multiple tables or building the table in such a way that the field could be represented in one column of the table and the data in another something to the effect of:

    
    
    Column Data
    Field1 This is data for field1
    Field5 This is data for field5

    K. Brian Kelley

    http://www.truthsolutions.com/

    Author: Start to Finish Guide to SQL Server Performance Monitoring

    http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1

    K. Brian Kelley
    @kbriankelley

  • Simply not create a temp table but a real table with text fields..... Shouldn't give a problem.

    Simply add an extra field to recognize your own records in it...... so you can delete them later.....(something tempdb does by itself)

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

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