Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Violation of PRIMARY KEY constraint 'PK_tbl_User_Messages'. Cannot insert duplicate key in object 'dbo.tbl_User_Messages'. The duplicate key value is (4769135).

$
0
0

We often get the problem below lately and only on some tables:

  • Violation of PRIMARY KEY constraint 'PK_tbl_User_Messages'. Cannot insert duplicate key in object 'dbo.tbl_User_Messages'. The duplicate key value is (4769135).


What we have: Merge Replication with 2 subscriber databases

What we know so far

  1. This only happened recently
  2. Our Identify key range is already big Publisher:150k Subscriber:75k. We have adjusted this thrice already before to no avail.
  3. We have checked the replication stats and we know that the inserts on the suspect tables are not that big enough to warrant automatic adjustment of identity ranges more than 10 times a day.
  4. We checked the identity range constraint on the the suspect tables and they all coincide with the range we had specified on them.

Question is, how do we find out what is wrong and how do we fix it? We're close to doing a re-initialization but we're really hopeful about it.

Any insights are welcome. Thanks!



MCP, MCSD, MCDBA (ANXA)


Viewing all articles
Browse latest Browse all 4054

Trending Articles