Querious Help 5

Comparing Databases

Find every structural difference between two schemas and generate the SQL to close the gap.

Querious can compare the structure of any two schemas (on the same server or different ones), and list every difference object by object, and generate a script that makes one match the other.

Comparison looks at the structure of the database's tables, views, functions, procedures, triggers, and events, including columns, indexes, keys, constraints, and options.

The result of a database comparison
The result of a database comparison

Target and Reference #

Querious looks at the structure of the Target and Reference databases, and creates an SQL script that modifies the Target database, so that it has an identical structure to the Reference database.

For example, compare your production database as the Target and development as the Reference to figure out which changes you need to push into production.

Side Meaning
Reference The schema that is "correct" or the "source of truth." Nothing is ever written to it.
Target The schema being checked, and modified to match Reference.

Starting a Comparison #

  1. Choose FileNew Database Comparison, or right-click a schema in the primary sidebar and choose Compare Database….
  2. Choose the connection and database for Target and Reference, and set the options. See Setting Up a Comparison.
  3. Click Compare.
  4. Read the results. See Reading the Results.
  5. To apply the differences, click Synchronize. See Synchronizing.

When To Use It #

  • Before a deployment: see exactly what a release will change by comparing staging against production.
  • After a deployment: confirm the migration applied everything it claimed to.
  • Across environments: find the column someone added directly to production and never put in a migration.
  • Across tenants: find the databases that have drifted when one application runs against many.
  • Auditing: compare a hand-built database against a known-good copy.