Skip to content
Jellykit

SQL INSERT Statement Generator

Paste rows from a spreadsheet and get batched INSERT statements for PostgreSQL, MySQL, SQLite or SQL Server.

  • Runs on your device
Loading tool

About SQL INSERT Statement Generator

Copy a block of cells from a spreadsheet, paste it here, and get INSERT statements ready to run. Rows are grouped into multi-row inserts of the size you choose, optionally wrapped in a transaction so a failure part way leaves the table untouched.

Numbers and booleans are written unquoted when every value in their column is one, text has its quotes doubled, and empty cells become NULL. Column names come from the first row, or from a list you type.

How it works

  1. Pasted cells arrive separated by tabs, which is detected automatically along with commas, semicolons and pipes. Quoted values may contain the separator or line breaks.
  2. A column is written unquoted only when every one of its values is a plain number or true/false; one exception and the whole column is quoted, so nothing is silently converted.
  3. Text values have single quotes doubled (and backslashes doubled for MySQL), and SQL Server text gets the N prefix so accents and emoji survive.
  4. Rows are grouped into batches; SQL Server accepts at most 1000 rows in one INSERT, so larger batches are cut to that.

Questions

What batch size should I use?

A few hundred rows per statement is a good default for every database here. Very large statements can hit packet or statement size limits, such as MySQL’s max_allowed_packet; one row per statement is slowest but easiest to debug.

Can I paste rows without a header?

Yes. Turn off "First row holds the column names" and either type the names, separated by commas, or leave them empty to write INSERT INTO table VALUES (…) with no column list.

Does it create the table?

No, it writes INSERT statements only. To get a CREATE TABLE with inferred column types as well, use the CSV to SQL converter.

How much can I paste?

Up to 5 MB of text, which is tens of thousands of typical rows.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.