CSV to SQL
Generates CREATE TABLE and INSERT statements from a table, with inferred types and a chosen dialect.
Turns a table into CREATE TABLE and INSERT statements for PostgreSQL, MySQL, SQLite or SQL Server, with the column types inferred from the data. It shows the columns as they will be created before it writes anything, which is where you catch a numeric column that came in as text.
Drop the CSV you want as SQL
Read in this tab. Nothing is uploaded. Files from Korean, Japanese, Chinese and Western Excel (CP949, Shift_JIS, GBK, Windows-1252) are recognised.
How to use it
Pick the dialect
It decides the quoting style, the auto-increment syntax and the text type. SQL Server gets NVARCHAR rather than VARCHAR, which is the difference between storing 한글 and storing question marks.
Check the inferred types
The table above the SQL shows each column, the identifier it will get, its type and whether it is nullable. A column you expected to be INTEGER showing as TEXT means a stray value is in it.
Set the batch size
A hundred rows per INSERT is a good default. One per row is easier to debug and much slower to run.
Common questions
Why is every identifier quoted?
Because a column called order, group or desc is a reserved word, and quoting only when necessary means getting the list of reserved words right for four dialects. Quoting unconditionally is boring and always works.
Are Korean column names safe?
In all four dialects when quoted, yes. If your server refuses them anyway, the ASCII-only option transliterates the identifiers while leaving the data alone.
What happens to quotes inside my data?
They are doubled, which is the SQL standard escape. For MySQL backslashes are doubled too, because MySQL alone treats a backslash as an escape inside a literal — without that, C:\temp arrives in the database with a tab in it.
Empty cell or NULL?
Your choice, and it matters: in SQL an empty string is a value and NULL is the absence of one, and they behave differently in comparisons, in COUNT and in a unique index. NULL is the default.
Feed it from
List Formatter
Turns lines into a comma list, quoted SQL IN clause, JSON array or bullet list, and back again.
SQL Formatter
Formats SQL with configurable keyword case, indentation and comma placement, across major dialects.
Timezone Converter
Converts a moment across timezones and shows a shared-hours grid for scheduling across regions.
CSV Viewer
Opens a large delimited file with type detection, column stats and sorting, without loading it all into memory.
Next
These accept what this tool produces, so the result can go straight in.
CSV Cleaner
Trims cells, normalises headers, fixes number and date formats and reports rows with the wrong column count.
SQL over CSV
Runs SQL against dropped CSV or TSV files in the browser — SELECT, WHERE, GROUP BY/HAVING, ORDER BY, LIMIT, CASE and a two-table JOIN — with the grammar on the page.
List Formatter
Turns lines into a comma list, quoted SQL IN clause, JSON array or bullet list, and back again.
SQL Formatter
Formats SQL with configurable keyword case, indentation and comma placement, across major dialects.
CSV Viewer
Opens a large delimited file with type detection, column stats and sorting, without loading it all into memory.
Currency Converter
Converts between about thirty currencies at the ECB’s daily reference rates, crossed through the euro, or at a rate you type in.