Skip to main content
T

CSV to SQL INSERT Statements

Paste a CSV and get SQL INSERT statements for MySQL, PostgreSQL, SQLite or MS SQL — optionally with a CREATE TABLE preamble (column types are inferred from the data). Multi-value INSERT mode collapses everything into one statement.

More options
Send output to:
Advertisement

How to use CSV to SQL

  1. Paste your CSV.
  2. Set table name and dialect.
  3. Optionally enable CREATE TABLE.
  4. Click Generate SQL.

What is CSV to SQL?

Each cell value is quoted appropriately — numbers stay unquoted, NULL handled, booleans recognized. Identifier escaping follows the chosen dialect (backticks for MySQL, double-quotes for Postgres, brackets for MSSQL).

Advertisement

FAQ

How are column types inferred?
Per-column heuristic: all-integer → INTEGER, all-numeric → DECIMAL, all-boolean → BOOLEAN, short strings → VARCHAR(255), longer → TEXT.
How does it handle commas, quotes, and newlines inside values?
The parser follows RFC 4180 CSV rules — fields containing commas or newlines are wrapped in double quotes, and quotes inside values are escaped by doubling them.
Can I set the table and schema name?
Yes, there's a Table Name field you can edit before generating. The output uses the name you provide in both the optional CREATE TABLE and all INSERT statements.

Related tools

← Back to CSV Tools · All tags

Last updated:

Advertisement