Groups | Blog | Home
all groups > sql server replication > july 2006 >

sql server replication : Identity Range not Reallocated


Thirsh
7/20/2006 9:24:01 AM
I replicate data between SQL Server 2000 and SQL CE 2.0 mobile devices. I
have configured my table in question to have 1,000,000 for the publisher
range size and 100 for subscribers. I left the default of 80 for the
percentage where a new range is assigned. The table's primary key field is
set as "Not for Replication".

My problem is that the maximum PK value currently in the table grew to be
greater than what SQL claims is the next Range Starting Value. When a
subscriber adds a new record, it is getting assigned a PK value that already
is used at the publisher and as a result, there is a merge conflict and the
record is deleted.

It is my understanding that it is the merge agents responsibility for
automatically adjusting identity ranges on the publisher. Does anyone know
why a new range is not being assigned when I synchronize (when the agent
Thirsh
7/20/2006 10:24:02 AM
If the "Next range starting value" is reported to be 1001, shouldn't the
range handed out to the next subscriber be 1001 - 1100?

[quoted text, click to view]
Hilary Cotter
7/20/2006 1:01:28 PM
it is possible that the range was exceeded too much and it is being
incremented but not enough.

For example your range is from 1-100. You try 1000 inserts. The first 100
make it in, the next 900 are kicked back, but the next identity value (dbcc
checkident(tablename)) will be 1001.

The next time the merge agent runs, it should increment the range to the
next available one which could be 201-300.

I can't understand why this is not occuring though.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Hilary Cotter
7/20/2006 2:33:32 PM
Yes, it should be. Check the table select * from MSrepl_identity_range in
the distribution database. The value of next_seed is the value which the
subscriber who needs incrementing or the next new subscriber should get.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

AddThis Social Bookmark Button