In a Microsoft SQL Server 2000 merge replication, when you insert data in an article that has automatic identity range handling enabled, you receive the following error message:
Server: Msg 548, Level 16, State 2, Line 1
The identity range managed by replication is full and must be updated by a replication agent. The INSERT conflict occurred in database 'p', table 't2', column 'id'. Sp_adjustpublisheridentityrange can be called to get a new identity range.
The statement has been terminated.
After you receive the error message, you synchronize the data for the publication. Then, when you insert some records from the publication and from one of the subscriptions into the article, you receive the following error message:
Server: Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint 'PrimaryKeyName'. Cannot insert duplicate key in object 'TableName'.
The statement has been terminated.
This problem occurs if the following conditions are true:
| • | A merge replication has two articles. |
| • | Each article has an identity column. |
| • | Automatic identity range handling is enabled for both articles. |
| • | The publication has two or more subscriptions. |
| • | You insert the data in the second article. |
Back to the top
This issue occurs because the same identity values are incorrectly inserted at the publisher and at the subscriber. This causes a conflict.
Back to the top
To resolve this issue, upgrade to SQL Server 2005.
Back to the top
To work around this issue, reinitialize the subscriptions for the publication after you add the new article.
Back to the top
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Back to the top
MORE INFORMATION
Steps to reproduce the behavior
| 1. | In SQL Server 2000, configure a merge replication. |
| 2. |
Add an article that has an identity column. |
| 3. |
Enable automatic identity range handling for the article. |
| 4. |
Add two or more subscriptions to the publication. |
| 5. |
Add another article that has an identity column. |
| 6. |
Enable automatic identity range handling for the second article. |
| 7. | Generate the snapshot, and then synchronize the data for the publication.
|
| 8. | Run the following statement on these subscriptions:select * from <SubscriptionDatabase>..MSrepl_identity_range Notice that the next_seed values of the identity column of the second article on all the subscriptions are the same. However, these values should be different. |
| 9. | Insert some records in the second article. |
Back to the top