To assist the testing in database migration or database changes, I have built a script that does the following:

  1. Pass in the connection of the 2 databases that you want to compare
  2. For each database, list out all the tables in alphabetical order
  3. For each table, print out the number of columns and the number of rows
  4. Print out the tables that exist in Database A but not not Database B and vice versa
  5. For tables that exist in both databases, compare the number of columns, number of rows, and database schema (e.g.: varchar or nvarchar)
  6. If database schema is different, print out the schema in both databases