Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Bulk Inserts Failing with SQL Server Merge Replication Identity Range Management

$
0
0

We have an issue with merge replication where we have a background process inserting rows in bulk. These inserts sometimes fail with the message that

The insert failed. It conflicted with an identity range check constraint in database ‘′, replicated table ‘’, column ‘′. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.

I've done a lot of reading and tinkering with inserts of different sizes and various settings for the Publisher Range Size, Subscriber Range Size, and Range Threshold Percentage. If I set the bulk insert size to something not divisible by 10 and repeatedly insert rows, I cannot find settings that are immune to the insert error. Even if I set Range Threshold Percentage to 50 or 1 it still doesn't allow me to insert batches that are close to 1/3rd the size of the Subscriber Range Size. Should there not be some setting like 1000 rows for the subscriber range and 50% threshold that if I insert 317 rows(prime number) repeatedly it doesn't error? If I were to say, I'm not going to insert more than 5000 rows at a time, does anyone have a recommendation for what to use for the settings that would never result in the insert error?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>