devxlogo

SQL 6.5 or 7.0 Identity Problem

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.

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist