Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Posts
    4

    Unanswered: Cannot create a row of size %d which is greater than the allowable maximum of %d

    I'm trying to execute an insert with a PreparedStatement object and I am getting the following Error message:

    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot create a row of size 8320 which is greater than the allowable maximum of 8060.

    Does anyone have a solution for this?

  2. #2
    Join Date
    Jul 2002
    Posts
    55
    You're inserting data that is larger than the maximum page size for SQL Server. See this page.

  3. #3
    Join Date
    Nov 2002
    Posts
    4

    Solution

    Originally posted by Mulligan
    You're inserting data that is larger than the maximum page size for SQL Server. See this page.
    Thanks for the link. I had already taken a look there before finding this forum but I couldn't understand why my data was longer than the page size for SQL because I was only inserting a small amount of data.

    I found that my problem due to MS SQL creating a temporary table based on my Insert Statement using the table definition for the size of the columns. In this case, I had a nvarchar(4000) column. This then generated a temp table with a column size equivalent to 8363 bytes but the page size is 8060. This happens even though the data I was inserting was much smaller than the max length.

    To resolve the problem I had to reduce to the column size to a maximum of 3868. This resolved the problem.

  4. #4
    Join Date
    Jul 2002
    Posts
    55
    Nice bit of detective work. And thanks for posting back with the solution - it makes a refreshing change from all the "How can I fix problem X?" "Like this." "Bye" postings

    Mull.

Posting Permissions

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