Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4096510
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:03:20+00:00 2026-05-20T20:03:20+00:00

I have two same databases on two different servers: one primary and one backup.

  • 0

I have two same databases on two different servers: one primary and one backup. Users are currently in both servers. We have an OrderId column in tblOrder in both db’s as the auto incrementing primary key. Now when I publish the orderid to our amazon server it sometimes shows an error because the orderid on both databases are the same number and a duplicate orderid is not accepted by the system.

I want to get the max orderid from both the server and then give the new orderid to current working database. I will remove the auto incrementing seed from it, so that on insert command I will insert the orderid manually.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:03:21+00:00Added an answer on May 20, 2026 at 8:03 pm

    Solutions:

    1. As mentioned already, you can change the increment on each identity field to 2, and have one server with a seed of 1 and the other a seed of 2.

    2. Presuming you don’t foresee handling more than 1 billion orders on each server, simply set the seed on the second server to 1,000,000,000. No need to change the increment.

    3. Use a uniqueidentifier (GUID) as your primary key rather than an integer. For SQL Server 2005 and above, you can set a default constraint to NEWSEQUENTIALID() to keep inserts from constantly creating page splits.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two databases at two different places, both databases are same with table
I have two tables in different databases on the same database server. Both the
I have same database schema on two different SQL servers 2008. I have one
I have two SQL Server (2000) databases. Both are used for the same project,
I have a table and two databases which have the same table, but one
Hi I have two database servers (2 different machine, but on same network). I
We have a bunch of VB6 applications that access two different database servers (both
I have two databases on the same server with the same name and different
Using SQL Server 2008 (R2). I have two tables in different databases (with same
I have two separate web applications, both in the same intranet. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.