What are the challenges you face when working across database platforms? Take the survey

Help! How to compare DB with 100s of backups - with no PK!

Hello everyone.

I have inherited a mess of a project. I have a database and its cooresponding backups over the last year. For reasons I will cannot explain, I must compare a particular table in every backup against the current database to see what changed in two colums of that table.

Because of the number of backups, I obvioulsy want to directly compare the backups against the data within SQL Server.

The problem is this: there is an int column that was used as a PrimaryKey, it was not set as a Primary Key!

How can I get SQL Data Compare to use that column as a primary key anyway?

If I have to resotre all of these backups, I will just die! :(


  • Options
    As you've discovered, when comparing directly to a backup file with SQL Compare Pro you will need primary keys, so it's not possible.

    The easiest way to do this is to mount the backups as virtual databases using SQL Virtual Restore, then use SQL Compare as you normally would. As far as SQL Compare is concerned it is just comparing two live, normal databases. You can find out more about SQL Virtual Restore at:

    http://www.red-gate.com/products/sql_vi ... /index.htm

    Let us know how you get on.

    Kind regards,

    David Atkinson
    Product Manager
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.