Compare 2 databases

  • I have OLD and NEW databases. I have added few data to the NEW database. Now I need to compare with the OLD database and whatever extra data I have in NEW should be moved to OLD.

    Clue me in with a example

    Thanks

    Raman

  • redgate sql compare will do the job and theres a 14 day trial.


    Phil Nicholas

  • sorry its a different redgate tool to do content, sql compare does structure!


    Phil Nicholas

  • I have done something like this:

    Insert INTO TrustChecks (

      CheckNumber,

      Amount,

      ClearedDate,

      ClearedStatus)

     SELECT

      ClearedChecks.CheckNumber,

      ClearedChecks.Amount,

      ClearedChecks.CheckDate,

      'C'

      FROM ClearedChecks

      Left Join TrustChecks

      On TrustChecks.CheckNumber = ClearedChecks.CheckNumber

      where TrustChecks.CheckNumber is NULL

    Only inserts the entries from the old table when the check number is null.  All other entries are ignored.

  • RedGate's tools are pretty good but I'm particularly fond of AdeptSQL tools. Plus, their package will do data and schema compares. And it's blindingly fast...

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

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