How to copy from one to another almost identical db

  • I have inherited a demo db  called demo_1 and a live db with +300 tables.

    They are almost identical, but there has been done some work on the live db, which has not been done on the demo. Its missing primary fields, some keys, a few identity fields.

     

    Its pretty easy to copy the live database structure to the demo, and has been done - Call it Demo_2

    Now i need to copy the content from the demo_1 to demo_2.

    I can of cause make it by making something like Insert from for each table, but there must be some scripting possibility, so it can be a bit faster.

     

    Best regards

     

    Edvard Korsbæk

  • Why not just make a backup of demo_1 and restore it over the top of demo_2?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • If i just backup/restores they get identical.

    But i think that what i will do is to make a script of demo_1 and demo_2, and use Ultra Compare to find out how many differences there are. I have found one important in excactly thw place where i try to solve something. Demo_2 has a primary field and key, which demo_1 has not, and they behave of cause different. But I do not think that there is many, and I can take care of them after the restore proces.

     

    So, problem solved I think.

     

    Best regards

     

    Edvard Korsbæk

  • Comparison tech is the way to do this. I'd suggest SQL Compare, but any tool that does this will help.

    Disclosure: I work for Redgate Software

  • This was removed by the editor as SPAM

Viewing 5 posts - 1 through 4 (of 4 total)

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