The insert failed. It conflicted with an identity range check constraint in database

-- -- 877 Reputation points
2021-04-09T22:18:20.67+00:00

Hi

When identity inserting into a table involved in merge replication I am getting the 'The insert failed. It conflicted with an identity range check constraint in database...' error. I have increased both 'Publisher range size' and 'Subscriber range size' to 200000 from 10000 and 1000 respectively. The threshold is still set to 80.

I have also run

exec sp_adjustpublisheridentityrange @table_name = 'MyTable'

I am still getting the same error. What can I do to fix this?

Thanks

Regards

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,808 questions
{count} votes

Accepted answer
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2021-04-12T07:49:55.513+00:00

    Hi @-- -- ,

    > The insert failed. It conflicted with an identity range check constraint in database...'

    Please try below steps;

    1. Change the identity range of the table from SSMS. Publisher>replication> Local replication > replication properties > Article Properties> Identity Range Management options> Change the appropriate values.
    2. Run the sp_adjustpublisheridentityrange stored proc on the Publisher.
    3. From the subscriber, force-synchronise the servers.

    Refer to the thread Insert into replicated table fails - identity range check to get detail information.

    Please also check if this blog The insert failed. It conflicted with an identity range check constraint could help you.


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments

0 additional answers

Sort by: Most helpful