Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2010
    Posts
    1

    Unanswered: Merging Databases

    Hello to all,

    I am using MS SQ 2005, and I have 5 databases running at different locations. The schema in all database are same.

    Now we need to merge all the tables in the database to the one database, as we decided for central access.

    How could it be done? without losing any referential integrity and database relationship within the database.

    Thank You.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    If you are using GUIDs as surrogate keys, then the data can be combined with no problem.
    If you are using natural keys, then the data can be combined as long as you check for duplicates first (which is a good thing to do anyway).
    If you are using identity keys, then you will need to load each full database into a set of staging tables, adding the data to production tables one at a time starting at the top of the hierarchy, and modifying the key values as you go. This takes considerable coding.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •