Works on this device. File exports run online.
Database & SQL Converter
Convert data and SQL in either direction: a CSV or JSON file becomes a CREATE TABLE statement and INSERT statements for your database, INSERT statements or a database dump become CSV or JSON, and a SQLite or dBase file becomes CSV, JSON or SQL. SQL written for one database can be rewritten for another.
Convert data and SQL
Choose the two databases in “Convert SQL to another database” below, then press Convert the SQL. sqlglot rewrites it on the server.
How to convert CSV or JSON to SQL
- Leave What to convert on CSV or JSON to SQL.
- Paste the data, or press Or open a CSV or JSON file. The first row of a CSV file holds the column names.
- Type the Table name and choose the Database: SQLite, PostgreSQL, MySQL or MariaDB, SQL Server or Oracle.
- Press Make SQL. The page reads the values of each column and chooses a type (whole numbers, decimals, dates, true or false, JSON or text); the table under the result shows them.
- Press Copy or Download, and run the SQL in your database.
The other conversions
- SQL to CSV or JSON: paste INSERT statements (one row or many rows each) or a dump file. Column names come from the INSERT or from the CREATE TABLE before it. PostgreSQL dumps with COPY ... FROM stdin are read too. Choose the table when there are several.
- Database file to CSV, JSON or SQL: open a SQLite file (.sqlite, .db) or a dBase or FoxPro table (.dbf). It is read in your browser.
- SQL from one database to another: paste the SQL and use Convert SQL to another database below. sqlglot rewrites it, for example MySQL’s backticks, LIMIT and IFNULL for PostgreSQL or SQL Server, and lists anything the other database cannot express.
- Microsoft Access (.mdb, .accdb) to CSV: use Convert an Access database below; Access files are read on the server with mdbtools.
Worked example
The sample CSV has 3 rows: id, name, price, in_stock and added. For PostgreSQL the page writes CREATE TABLE IF NOT EXISTS products with id INTEGER, name TEXT, price NUMERIC(5,2), in_stock BOOLEAN and added DATE, then one INSERT with three rows; the empty date of row 3 becomes NULL and the name Chair, oak keeps its comma.
Limits you should know
- Types are chosen from the values, so a column of numbers that should stay text (such as 007 or phone numbers) needs its type changed by hand, or the data given as JSON strings.
- SQL is read, not run: an INSERT ... SELECT, a function call such as NOW() or a stored procedure is copied as written or skipped, and the page says so.
- The page cannot connect to a database server. To export from a running database, use the database’s own export, then convert the file here.
- Up to 200,000 rows at a time in the browser; split larger files.
Privacy
The conversions above run in your browser. Using a server conversion box sends the selected SQL or file to Toolvito. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.