Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

The insert failed. It conflicted with an identity range ch..

 
   Database Help (Home) -> Replication RSS
Next:  Pulling a number out of an nvarchar field  
Author Message
Ben82

External


Since: Sep 16, 2004
Posts: 22



(Msg. 1) Posted: Thu Dec 18, 2008 9:55 am
Post subject: The insert failed. It conflicted with an identity range check cons
Archived from groups: microsoft>public>sqlserver>replication (more info?)

We have a fairly standard merge replication setup on SQL 2005 with MSDE
subscribers. (We previously used SQL 2000 with MSDE subscribers)

All of our published articles have the same properties:
@pub_identity_range = 250,000
@identity_range = 5,000
@threshold = 80

I've read this over many times:
http://msdn.microsoft.com/en-us/library/ms152543.aspx

The issue we are encountering happens for users who are working directly on
the publisher (not subscribers).

We have a table on our publisher that seems to be filling up it's identity
ranges in about once a month. It seems as though when it does fill up its
range of values that it doesn't get its new ranges soon enough and users
experience the error "The insert failed. It conflicted with an identity range
check constraint"

The SQL user that is doing all the inserts is a member of the db_owner fixed
database role, and therefore I believe it should be able to automatically
assign a new range.

What seems to be happening is for about one day every month users receive
the error and the next day the are able to insert more records and we have
not touched anything.

Can anyone explain this behavior or suggest how we could troubleshoot the
problem further?

Thanks!

 >> Stay informed about: The insert failed. It conflicted with an identity range ch.. 
Back to top
Login to vote
Paul Ibison

External


Since: Oct 03, 2008
Posts: 145



(Msg. 2) Posted: Thu Dec 18, 2008 3:14 pm
Post subject: RE: The insert failed. It conflicted with an identity range check cons [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ben,
this is my understanding:
the allocation to the second range is automatic and doesn't require
synchronization. However, it doesn't use the threshold and instead relies on
the range filling up to completion. If you had one space left and did an
insert of 2 rows in a transaction, or some sort of bulk insert, even insert
into select...., then the new range wouldn't get allocated. Have a look at
the insert replication trigger to see some of this.
HTH,
Paul Ibison, www.replicationanswers.com

 >> Stay informed about: The insert failed. It conflicted with an identity range ch.. 
Back to top
Login to vote
Ben82

External


Since: Sep 16, 2004
Posts: 22



(Msg. 3) Posted: Thu Dec 18, 2008 3:42 pm
Post subject: RE: The insert failed. It conflicted with an identity range check [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Paul,

Thank you so much for your insight!

What you describe makes perfect sense as to the problems we are
experiencing. I've looked at the insert trigger that replication created on
our table and sure enough, it will only reseed to the secondary range once
the first range has reached it's "range_end".

As you can guess this is causing us huge headaches for particular tables
where we often run transactions with multiple inserts. Do you know of any
way around this other than modifying the triggers manually? It is my
understanding that the @threshold parameter is only used for backwards
compatibility, is that right?

Obviously we could avoid the problem by making our ranges so large that the
range_end would never be reached, but if possible I would like to find a
better solution to this problem.

Again, thanks!


"Paul Ibison" wrote:

> Ben,
> this is my understanding:
> the allocation to the second range is automatic and doesn't require
> synchronization. However, it doesn't use the threshold and instead relies on
> the range filling up to completion. If you had one space left and did an
> insert of 2 rows in a transaction, or some sort of bulk insert, even insert
> into select...., then the new range wouldn't get allocated. Have a look at
> the insert replication trigger to see some of this.
> HTH,
> Paul Ibison, www.replicationanswers.com
 >> Stay informed about: The insert failed. It conflicted with an identity range ch.. 
Back to top
Login to vote
Paul Ibison

External


Since: Oct 03, 2008
Posts: 145



(Msg. 4) Posted: Thu Dec 18, 2008 3:53 pm
Post subject: RE: The insert failed. It conflicted with an identity range check [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

As far as I know, you can increase the range without requiring
reinitialization. So, you could increase the range size to something huge and
then you only need to make sure you hit it once and then you're ok.
I agree with what you think about the threshold. I've posted a comment in
sp_addmergearticle in the BOL (on the web). sp_changemergearticle has this
info but strangely not sp_addmergearticle.
Sorry didn't have anything special to advise Smile
Rgds,
Paul
 >> Stay informed about: The insert failed. It conflicted with an identity range ch.. 
Back to top
Login to vote
Ben82

External


Since: Sep 16, 2004
Posts: 22



(Msg. 5) Posted: Thu Dec 18, 2008 5:11 pm
Post subject: RE: The insert failed. It conflicted with an identity range check [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for your contributions to the community Paul!

"Paul Ibison" wrote:

> As far as I know, you can increase the range without requiring
> reinitialization. So, you could increase the range size to something huge and
> then you only need to make sure you hit it once and then you're ok.
> I agree with what you think about the threshold. I've posted a comment in
> sp_addmergearticle in the BOL (on the web). sp_changemergearticle has this
> info but strangely not sp_addmergearticle.
> Sorry didn't have anything special to advise Smile
> Rgds,
> Paul
 >> Stay informed about: The insert failed. It conflicted with an identity range ch.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Merge Replication failed to allocate new identity range - Hi, We have Merge Replication running between two SQL Server 2005 servers (Std Edition - x64 bit). Both the servers are on the same network. We were getting these Error messages: The Publisher failed to allocate a new set of identity ranges for the ..

Updating identity range in a replicated database - I am using sp_adjustpublisheridentityrange to update and identity range in a subscriber... the identity range was exhausted: I used the following in the publisher tot update the publication: sp_adjustpublisheridentityrange @publication = 'PUB_1',..

Identity Range Full on a Clean Install - Hi guys, I have had problems with the identity range being full on a few tables on the subscriber. What I did was to unisntall the publisher and do a fresh install of MSDE (the subscriber). I published again and subscribed and everything went....

Identity Range questions with merge replication. - Hello, I was wondering what calculations SQL 2005 uses to initiliase the step up when a range of identities are used up. I have set up a very small example using merge replication. The Publisher has one table that has an Identity field. I have set the..

Identity ranges lost during failed synchronization - Hi, I've run into a problem with SQL Server replication and really need some help. Background ---------- We are using Merge Replication with SQL Server 2005 Enterprise edition at the publisher and SQL Express at the subscribers (around 25 of them). Th...
   Database Help (Home) -> Replication All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]