SQL

SQL Schema Diff

Compares two DDL scripts and lists every structural difference between them.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the current DDL into the first box.
  2. Paste the proposed DDL into the second box.
  3. Select Compare to list the added, removed and changed tables and columns.

What schema diff does

Paste the DDL for two versions of a schema and this lists what changed: tables added or removed, columns added or removed, and columns whose type, nullability or default moved. It is the check to run before a release when the migration script and the schema script have drifted apart.

This compares declarations, not databases. It cannot see indexes created separately, data that would violate a new NOT NULL, row counts, or anything about the state of either environment. A difference listed here is real; the absence of a difference only means the two scripts agree, which is not the same as the two databases agreeing.

Frequently asked questions

Tables added or removed, columns added or removed, and columns whose declared type, nullability or default has changed. Each difference is listed with the before and after value.

No. It tells you what differs; deciding the safe order of ALTER statements, whether a type change needs a backfill, and what to do about existing rows is a judgement call that depends on your data and your downtime budget.

Not directly. Export the DDL for each and paste both. The comparison is between what the two scripts declare, so it will not notice indexes, permissions or data that exist in one environment and not the other.