Solved

IDENTITYKEY

Posted on 2007-12-06
14
1,811 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:Richardsoet
  • 6
  • 6
14 Comments
 
LVL 17

Expert Comment

by:xDJR1875
Comment Utility
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
 

Author Comment

by:Richardsoet
Comment Utility
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
 

Author Comment

by:Richardsoet
Comment Utility
Please how can i adjust ranges please please write the procedure to follow please
0
 
LVL 17

Expert Comment

by:xDJR1875
Comment Utility
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
 

Author Comment

by:Richardsoet
Comment Utility
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
 
LVL 17

Expert Comment

by:xDJR1875
Comment Utility
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Expert Comment

by:xDJR1875
Comment Utility
Have you tried
sp_adjustpublisheridentityrange  @table_name='tb_CCMember'
0
 

Author Comment

by:Richardsoet
Comment Utility
How do I check the  identiy range to know am running out range on a table used for merge replication 2005
0
 

Author Comment

by:Richardsoet
Comment Utility
is there any performance issue on replication when increase the  identity range???
0
 
LVL 17

Accepted Solution

by:
xDJR1875 earned 500 total points
Comment Utility
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
 

Author Comment

by:Richardsoet
Comment Utility
does it affect the size of the table in any how if the identity is increased to maximum
0
 
LVL 17

Expert Comment

by:xDJR1875
Comment Utility
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now