4

I am using identity columns in my merge replication solution to give people an id they can tell us over the phone (i.e. to support staff). A rowguid column would be too hard for this.

I have noticed that int identity columns are replicated no trouble, and each client subscription has a range of identity values it can use.

i.e. select * from MSmerge_identity_range

range_begin    range_end    next_range_begin    next_range_end
6003           7003         7003                8003

I'm just wondering what happens if you do some kind of bulk insert for instance which inserted 5000 new records into this table. What would happen to the identity column then?

1 Answer 1

3

If you attempt to bulk insert more rows then available identity values between syncs you will get an error:

The identity range managed by replication is full and must be updated by a replication agent.

The key here is to allocate range sizes large enough to accommodate for the amount of inserts that may occur between syncs. You can specify the range sizes in article properties when adding articles to the publication.

1
  • Bulk insert is somewhat a worst case scenario which is not going to happen in our case. It is more likely that a user won't sync for ages, but unlikely that they could add more than a 2000 records between syncs. This error would basically be an exception right, i.e. a SqlException or something like that?
    – peter
    Commented Jun 5, 2012 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.