Home Forums SQL Server 2005 Backups help with best practice for merging 2 sql databases RE: help with best practice for merging 2 sql databases

  • thank you

    i'm testing redgate's data compare (which is by the way 14 days trial and not 30) and it seems good to add / update / delete rows very easily

    but this is the problem,

    old database has 120 records on tableA (primary key 1-120) when i left it

    new temp database doesn't have all 120 records because only 100 records was backed up so it has only 100 records (primary key 1-100)

    since we continue using the temp database it now has 140 records (primary key 1-100 from original database and 101-140 from temp database)

    the sql compare would want to insert 40 new records to the tableA but it cannot use 101-120 key because it's already exists on the original database so i guess it will try to update and destroy them.

    and anyway, it cannot insert with correct keys because

    for example:

    i have table "tbl_users" (code(index), firstname, email)

    and table "tbl_priceoffers" (code(index), usercode(from tbl_users), price)

    redgate generate script to insert "tbl_priceoffers" before "tbl_users"

    but even if it was the correct order (i can edit), it cannot insert "tbl_priceoffers" row without having @@identity from the recently inserted "tbl_users" row

    any thoughts ?