Advertisement

06.04.2008 at 08:41AM PDT, ID: 23457134
[x]
Attachment Details

Can I maintain value of identity Fields in Merge Replication?

Asked by alexking in SQL Server 2005, MS SQL Server

Using Sql server 2005, please can anyone tell me if this is possible:

Database 1 has a table [Users] that contains an identity field User_ID, starting at 1. It also has a Location field, always set to 1 for users added at this site.

Database 2 has the same table, User_ID as identity field starting at 1, but Location field set to 2.

So I have At Database 1                                     Database 2
User_ID                 Location                               User_ID                 Location
1                                1                                         1                                2
2                                1                                         2                                2
3                                1                                         3                                2

Is there any way to have these sites replicating so that I end up with the following at both sites:
User_ID                 Location                          
1                                1                                        
2                                1
3                                1                                        
1                                2
2                                2                                        
3                                2

It seems that because I am using an identity field, the user_id is re-seeded on merging. This is obviously a simplified example and it is not feasible to have different start ranges for the seeds. Changing the "not for replication" option seems to have no effect. Is this possible?
Start Free Trial
[+][-]06.05.2008 at 04:40AM PDT, ID: 21718163

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, MS SQL Server
Sign Up Now!
Solution Provided By: VMontalvao
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.05.2008 at 04:44AM PDT, ID: 21718198

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628