Richardsoet
asked on
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 @identityrangemanagementop tion 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_adjustpublisheridentity range; for the Subscriber, run the Distribution Agent or the Merge Agent.
The statement has been terminated.
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_adjustpublisheridentity
The statement has been terminated.
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.
ASKER
Am using the below script but getting error
sp_adjustpublisheridentity range '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_adjustpublisheridentity range, Line 27
There must be one and only one of '@publication' and '@table_name' that is not NULL.
sp_adjustpublisheridentity
'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_adjustpublisheridentity
There must be one and only one of '@publication' and '@table_name' that is not NULL.
ASKER
Please how can i adjust ranges please please write the procedure to follow please
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_adjustpublisheridentity range 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_adjustpublisheridentity range to allocate a new range of values for a Publisher.
When executing sp_adjustpublisheridentity range, either publication or table_name must be specified.
If both or neither are specified an error is returned.
sp_adjustpublisheridentity
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_adjustpublisheridentity
When executing sp_adjustpublisheridentity
If both or neither are specified an error is returned.
ASKER
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
How do I resolve this problem
Here are a couple links as well that might prove useful
http://www.simple-talk.com/sql/database-administration/the-identity-crisis-in-replication/
http://thedotnet.com/nntp/397582/showpost.aspx
http://www.simple-talk.com/sql/database-administration/the-identity-crisis-in-replication/
http://thedotnet.com/nntp/397582/showpost.aspx
Have you tried
sp_adjustpublisheridentity range @table_name='tb_CCMember'
sp_adjustpublisheridentity
ASKER
How do I check the identiy range to know am running out range on a table used for merge replication 2005
ASKER
is there any performance issue on replication when increase the identity range???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
does it affect the size of the table in any how if the identity is increased to maximum
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.
Remember though, that as you add more records your table size will grow. But the column that holds the identity remains the same.