About the SQL INSERT to CSV Converter
When a colleague sends a .sql file and you only need to look at the data, loading it into a database is overkill. This converter parses the first table's INSERT statements, uses the column list as the header, and writes one CSV row per VALUES tuple. Strings with commas or quotes are quoted correctly, NULL becomes an empty cell, and numbers are written bare.
Multi-row inserts and dumps with comments are handled. If the file contains several tables, the first is converted; cut the file down to the table you need for the others. The tab delimiter option produces text that pastes straight into a spreadsheet.
The parser is shared with SQL to JSON, so what works there works here. To go the other way, CSV to SQL generates INSERT statements with inferred column types.
How to use
- Paste or upload the SQL script.
- Choose comma or tab.
- Download the CSV or copy it into a sheet.
Common questions
- Which table is converted if there are several?
- The first one found. Paste the statements for one table at a time for others.
- How are NULLs written?
- As empty cells, which is how spreadsheets represent missing values.
- Can it read UPDATE or SELECT output?
- No, only INSERT ... VALUES statements contain rows in a parseable form.