Transaction Replication - How does the Identity range work.

Copper Contributor

Hi All, 

 

I am setting up a transactional replication for MS SQL 2019. The team is using Identitiy columns as the PK on the tables. I know they are a issue when a failover happens. 

 

I would like to set my Identity Range for my Publisher to be from 1 to 2 lakhs and in case of failure the subscribr should start from 2 lakhs.  

 

Is this possible if yes can anyone help in providing a sample code to do the same. 

 

2 Replies

@olafhelper 

 

Thanks for your response. But I want to know what values can I set for 

 

Publisher Range Size 

Subscribers Range Size 

Next Range Starting Value 

 

Also If my publisher goes down Will the subcriber use the Seeding from 1 or will it start from the Next Range Starting Value ? 

Or Do I need to manually update the Seeding everytime it Fails and reset after I restore my Publisher.