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

  • SEARCH
  • Home
  • 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 6341147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:58:21+00:00 2026-05-24T19:58:21+00:00

I have a central database and a unique database for a project I am

  • 0

I have a central database and a unique database for a project I am working on. The central database allows me to provide users with default options and data.

The unique database matches the central database structure to allow users own customized data. I have views that union each identical table pair.

The “primary key” field in each view is set as a primary key in the dbml I am using (Linq-to-sql). I then add associations to other tables in the dbml.

This means that I cannot set both tables to auto-increment with a base of 0, because the primary keys are used as “foreign keys” in unique db tables (I know they’re not strictly foreign keys in this instance).

Therefore in the view, I need all records from each table pair to have a unique primary key.

I have thought about setting the unique database pk base number at 1000000 or something, but this eventually may backfire on me when the global database (0 base) caught up.

I also though about prefixing each with a number in the view, e.g.

Global: 11, 12, 13, 14, 15, 16, 17, 18, 19, 110 ,111
Unique: 21, 22, 23, 24, 25, 26, 27, 28, 29, 210, 211

I am worried how this may affect performance when querying, this has to be as efficient as possible.

Not sure of the best method?

  • 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-24T19:58:22+00:00Added an answer on May 24, 2026 at 7:58 pm

    One issue with your solution is that it is brittle and would fail if you ever needed more than two sources to be merged. This may or may not be a realistic risk depending on your business scenario.

    People sometimes get around this issue by using a GUID for a candidate key. In this way, your source DBs have the IDENTITY columns as PK and also a GUID which is unique but not primary in the source databases. However, in the merged view the PK is the GUID and the originial source keys (IDENTITY) are brought along for the ride but don’t actually get used in PK/FK relationships.

    In this type of model, the merged view typically also includes some kind of source code column which tells you where the row came from. If you do this, then source code + identity key is also a candidate key in the merged view.

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

Sidebar

Related Questions

I'm developing an app which will have a central database users can add entries
I have an application that is made up of the following: A central database
I have a centrally hosted database (MS SQL Server) and distributed clients save data
I have a table in a central database that gets constantly appended to. I
We have a central database for accounts. It contains login information, and a field
We've got the following scenario: Central Database (replicated across multiple servers) Client Database 1
I have a project that adds elements to an AutoCad drawing. I noticed that
Let say I have the following desire, to simplify the IConvertible's to allow me
I have a project coming up that involves a desktop application (tournament scoring for
Have just started using Google Chrome , and noticed in parts of our site,

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.