Share via

How to fix The number of row value expressions in the INSERT statement exceeds the maximum allowed number of 1000 row values.

Rabia Kurnaz 386 Reputation points
2023-06-15T08:41:02.9533333+00:00

How to fix The number of row value expressions in the INSERT statement exceeds the maximum allowed number of 1000 row values.

Azure SQL Database
SQL Server Integration Services
SQL Server Migration Assistant
SQL Server Migration Assistant

A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.

SQL Server Analysis Services
SQL Server Analysis Services

A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.

SQL Server | Other

Answer accepted by question author

  1. Viorel 126.9K Reputation points
    2023-06-15T18:37:18.1766667+00:00

    Try to split the statement. For example, replace

    insert Table1 values
    ( 1, 2, 3 ),
    ( 4, 5, 6 ),
    ( 7, 8, 9 )
    

    with

    insert Table1 values
    ( 1, 2, 3 ),
    ( 4, 5, 6 )
    insert Table1 values
    ( 7, 8, 9 )
    

    Each fragment should not exceed the maximum allowed number of 1000 row values.

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 47,616 Reputation points
    2023-06-16T04:48:42.9533333+00:00

    The number of row value expressions

    You provide very lerss informations and so we have to guess:

    You have an INSERT statement with a lot of fix VALUE in the manner of

    INSERT INTO yourTable (Column1)
    VALUES (1), (2), (3), ..
    
    

    exceeds the maximum allowed number of 1000 row values.

    The do what the error imply, reduce the count of values and split the INSERT statement into several ones.


  2. Anonymous
    2023-06-16T01:46:27.6466667+00:00

    Hi @Rabia Kurnaz

    Or you can try the workaround mentioned in this thread.

    https://stackoverflow.com/questions/7737472/how-can-i-insert-100000-rows-in-sql-server

    Best regards,

    Percy Tang


    If the answer is the right solution, please click "Accept Answer". If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.