two databases, identical schema, migration question

  • Matthew Cushing

    SSCrazy

    Points: 2898

    I have a client who is thinking of combining two separate databases into one larger one. The schema are identical so it's just a case of making sure of pulling the data in so that new keys are generated and the data sits side by side with the other.

    Is is just a question of using a migration tool like Redgate to migrate the data, or do I have to write a series of scripts to insert all the data from db1 into db2? The main issue is that the schema is quite complicated.

    Just looking for advice at this point.

  • Grant Fritchey

    SSC Guru

    Points: 396209

    As much as I'd like to say that Red Gate is the way to go, I think you'd be better off using SSIS to build out a migration between the two. The Red Gate tools for moving data around are good at what they do, but they won't be able to generate new key values and apply those new values to related tables. You can do that much easier through SSIS.

    ----------------------------------------------------
    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • Matthew Cushing

    SSCrazy

    Points: 2898

    I was thinking about that approach last night. I have a main table that has several dependent tables, so looking at insert into table1 get generated key, use that for all other tables to replace original key and so on and so on. Just have to figure out all of the relationships that need to be updated now 🙂

    YAY for not well formed schemas!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply