Tricky problem!

  • Hi all,

    I'm trying to manage a merge replication between two devices: a PC (Publisher) and a Pocket PC (Subscriber). Let's suppose there is only one table into the db:

    T_Ex

    ID (Identity column 1,1), Description

    and there are three records inserted into the publisher's db (1, 'aaa' - 2, 'bbb' - 3, 'ccc'). When the subscriber synchronize itself to the publisher and then I try to insert a new record from the pocket pc, I got the last record inserted with ID = 1 resulting in an error cause there was already a record with ID = 1. It seems that the identity value in the subscriber's table is reseed to 1. How can I manage identity replication?

    Thanks in advance!

  • What we do is have SQL Server manage the identity ranges for most of our tables.  If you go to publication properties, Articles tab, then click on the ... for the table, there will be a tab for identity range.  You can set the range for publisher vs subscriber.  For example.  1-10000 publisher, 10001-20000 subscriber, and new ranges will be allocated when they reach the threshold percentage.

    Otherwise you can reseed the subscriber manually, if you can make sure that they won't conflict, like picking a large seed, say 1 billion.  Or you can set up even numbers on one server and odd on another, or positive on one server and negative on the pocket PC.

    HTH

    Dylan Peters
    SQL Server DBA

  • Hi Dylan,

    thank you for the answer. I'll try to make use of your advice. I feel free to contact you if I would still have problems ok? Have a nice time!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply