IDENTITYKEY

Am getting the below error message when trying to do a bulk insert from the Publisher to Subscriber in SQL 2005. When I set up replication  @identityrangemanagementoption is set to auto
Msg 548, Level 16, State 2, Line 603
The insert failed. It conflicted with an identity range check constraint in database 'MTTTT, replicated table 'dbo.tb_CCMe', column 'ccmb_SID'. If the identity column is automatically managed by replication, update the range as follows: for the Publisher, execute sp_adjustpublisheridentityrange; for the Subscriber, run the Distribution Agent or the Merge Agent.
The statement has been terminated.
RichardsoetAsked:
Who is Participating?
 
Daniel ReynoldsConnect With a Mentor Software Applications Developer / IntegratorCommented:
The performance should not be affected at all.
Basically it just allows for each machine to save with a unique key (within the range).
Then when the merge is done, there are not any clashes between keys.

To view your key ranges, Open up MS SQL Server Mgmt Studio...Click the Replication Tree Node...Click the Local Publications Tree Node. Right Click the Publication you are interested in and select properties. In the next dialogue select Articles.. You can then select to view the specific table properties.
You should be able to look at your published articles and view the properties of each table to view the current identity range.
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
When I have set up replication in the past, a range needs to be selected for the identity fields of each database. I wonder if the count of your records has exceeded your ranges, and it would now require the ranges to be adjusted.
0
 
RichardsoetAuthor Commented:
Am using the below script but getting error

sp_adjustpublisheridentityrange  'MotivanoUKLiveWebCore',
    'tb_CCMemberBenefit'

Please rewrite it for me  my table name is 'tb_CCMemberBenefit'
my publication name is MotivanoUKLiveWebCore
Msg 21314, Level 16, State 1, Procedure sp_adjustpublisheridentityrange, Line 27
There must be one and only one of '@publication' and '@table_name' that is not NULL.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
RichardsoetAuthor Commented:
Please how can i adjust ranges please please write the procedure to follow please
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Note the following in the useage deescription of the stored procedure to adjust your ranges.:  The last sentence is very important. (Only supply the publication or table name, NOT BOTH) You appear to be supplying both. Give it a whirl with only one.

sp_adjustpublisheridentityrange is used in all types of replication.

For a publication which has the auto identity range enabled, the Distribution Agent or Merge Agent is responsible for automatically adjusting the identity range in a publication based on its threshold value. However, if for some reason the Distribution Agent or Merge Agent has not been run for a period of time, and identity range resource have been consumed heavily to the point of threshold, users can call sp_adjustpublisheridentityrange to allocate a new range of values for a Publisher.

When executing sp_adjustpublisheridentityrange, either publication or table_name must be specified.
If both or neither are specified an error is returned.
0
 
RichardsoetAuthor Commented:
My problem is down to a table tb_CCMember which I was trying to do Bulk insert of 30000 records,
How do I resolve this problem
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Have you tried
sp_adjustpublisheridentityrange  @table_name='tb_CCMember'
0
 
RichardsoetAuthor Commented:
How do I check the  identiy range to know am running out range on a table used for merge replication 2005
0
 
RichardsoetAuthor Commented:
is there any performance issue on replication when increase the  identity range???
0
 
RichardsoetAuthor Commented:
does it affect the size of the table in any how if the identity is increased to maximum
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
No, the data size of the column remains the same.

Remember though, that as you add more records your table size will grow. But the column that holds the identity remains the same.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.