Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Apr 7, 1999

SQL 6.5 or 7.0 Identity Problem

Question:
I want to use replication between two SQL servers in which I used Identity properties in some tables. How can I preserve data integrity and maintain my application functionality on both servers, knowing that data syncronization must be done with dual direction?

Answer:
If I understand you correctly, you have the same table in two databases. The table is updated in both databases. You'd like to replicate from one to another so that each database has a copy of the other database's rows. Yet you have an identity field defined in the table. You want to avoid having a collision on the identity field when the application updates the table.

One possible and easy method might be to define the starting point of the identity column differently on each server. On one server you can set the initial value to 0 while on the other start off at ten million or some other large enough number.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date