Why a SQL dialect converter?
Every database has its own flavor of SQL. PostgreSQL uses `SERIAL` for an auto-incremented key, MySQL uses `AUTO_INCREMENT`, MSSQL uses `IDENTITY(1,1)`, Oracle uses `GENERATED AS IDENTITY`. Standard SQL is theoretical, in practice every vendor bolted on their own extensions.
You paste a query from one database, pick the source and target dialect, and the tool rewrites the bits that differ: column types (TINYINT vs BOOLEAN vs BIT vs NUMBER(1)), auto-incremented keys, pagination (`LIMIT/OFFSET` vs `TOP` vs `FETCH NEXT`), time functions (`NOW()` vs `GETDATE()` vs `SYSDATE`), string concatenation (`||` vs `CONCAT()`), identifier quoting (`` `id` `` vs `[id]` vs `"id"`).
On the right you see the list of changes applied with a short reason. No magic, just a decent ruleset that covers about 80% of porting simple schemas.
How to use it
- Pick the source dialect (where the query is from) and the target dialect (where you want it to run).
- Paste your SQL into the left panel. Can be `CREATE TABLE`, `SELECT`, `INSERT`, whatever.
- On the right you get the converted result, automatically formatted for the target dialect.
- Below you see the list of changes made: each rule with a "before / after" diff and a short label.
- Copy the result with the Copy button. Then sanity-check the logic (regex cannot do everything, sometimes manual tweaks are needed).
- Use the swap arrows to flip source and target. Handy when you want to convert in both directions.
When this is useful
Common scenarios:
- Migrating from MySQL to PostgreSQL. The classic: the company grew, MySQL is not enough, you move to Postgres. The schema needs to be rewritten. This tool handles 80% of the grunt work.
- Supporting two databases in one ORM. You work with Prisma or Drizzle, the client runs MSSQL, your local dev is PostgreSQL. You need two versions of the init script.
- Building BigQuery tables from an operational database. The MySQL schema needs to be adapted to BigQuery, which has no AUTO_INCREMENT and many type differences.
- Code review of a query from a coworker who writes against another engine. Quick sanity check whether it will run on your database.
- Learning differences between dialects. Paste a simple query, toggle the target dialect, watch what changes. Better than reading dry docs.
- Portability check of an existing schema. The conversion highlights where you use vendor-specific constructs.
After conversion, format the output with our SQL formatter. Want an ORM schema instead? See the SQL to ORM converter.