Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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 Jun 5 '12 at 0:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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