How to compare SQL schemas with SQL Schema Diff
Put the two DDL definitions in Schema A (original) and Schema B (modified), choose SQL dialect, and inspect the Change log. SQL Schema Diff reads CREATE TABLE, CREATE INDEX, and CREATE VIEW statements, then lists each affected object with its earlier and later details.
Compare DDL in a selected SQL dialect
- Paste DDL into Schema A (original) and Schema B (modified).
- Choose SQL dialect: MySQL / MariaDB, PostgreSQL, SQLite, or SQL Server (T-SQL).
- Select Upload beside either schema to load a
.sql,.ddl, or.txtfile. - Read the Change log, then select Download CSV or Download Excel when it contains changes.
The comparison starts after both schema fields contain text. If you change SQL dialect, the page parses both fields again with that selection.
What the Change log reports
The Change log lists added or removed tables, plus added, removed, and changed columns, types, nullability, defaults, primary keys, foreign keys, unique constraints, check constraints, indexes, and views. For a changed column, it lists every differing property with its earlier and later value.
Schema A: CREATE TABLE users (id INT PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE);
Schema B: CREATE TABLE users (id INT PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
Change log: Added column | users.created_at | timestamp DEFAULT CURRENT_TIMESTAMP
Which SQL statements SQL Schema Diff parses
The parser reads CREATE TABLE, CREATE INDEX, and CREATE VIEW definitions. It skips ALTER TABLE, triggers, stored procedures, functions, sequences, permissions, and data statements such as INSERT, UPDATE, and DELETE. The warnings panel reports parser or dialect limitations.
Comments are removed before statements are split. Generated-column expressions are compared as a column property. Partitioning clauses, storage options, unparsed column modifiers, and table tail options are not broken into separate structural changes.
How SQL Schema Diff reports renames
SQL Schema Diff compares table and column names. It does not infer a rename, so a renamed object appears in the Change log as one removed object and one added object. Review those pairs before treating them as separate changes.
Where to use a schema comparison
Before reviewing a migration, compare the old and new CREATE TABLE definitions. The Change log then exposes a new column, default, or key as its own entry.
For two exported DDL files, compare tables, indexes, foreign keys, or views without connecting the page to either database. The parser works on the text in Schema A (original) and Schema B (modified).
To check a view change, place both CREATE VIEW definitions in the fields and inspect the changed view entry beside the displayed schemas.
Choose a database comparison tool
Database Compare Tools groups database comparison pages. Use SQL Schema Diff for SQL DDL definitions. Use Parquet Diff for two local Parquet files when you need field types, repetition or nullability details, row-group counts, or record differences.
Frequently asked questions
How do I compare two SQL schemas?
Paste the two DDL definitions into Schema A (original) and Schema B (modified), choose SQL dialect, and inspect the Change log. You can select Upload for either field instead.
Does SQL Schema Diff compare table data?
No. It compares structural DDL objects. It does not connect to a live database, execute SQL, or inspect table rows.
Does SQL schema diff detect renamed columns?
No. SQL Schema Diff reports a renamed table or column as a removed object and an added object.
What happens to ALTER TABLE statements?
ALTER TABLE statements are skipped from the structural comparison and contribute parser or dialect warning text. Compare the resulting CREATE TABLE definitions to inspect table structure changes.