← Back

SQL INSERT Generator (All‑In‑One)

LOCAL

Generates SQL INSERT statements from CSV, TSV, JSON, JSONL, table text, or Excel.

Input

Generated SQL Statements

What is SQL INSERT Generator (All‑In‑One)?

SQL INSERT Generator turns CSV, TSV, JSON, JSONL, copied table text or the first worksheet of an Excel file into SQL text. Choose MySQL/MariaDB, PostgreSQL, SQLite or MSSQL for identifier quoting and selected value conventions. The tool does not connect to a database, create a table or execute the generated statements.

How to use SQL INSERT Generator (All‑In‑One)

Enter users as the table name, choose SQLite and JSON, and paste [{"id":1,"name":"O'Brien","active":true,"note":null}]. Leave Bulk Insert enabled and choose Generate SQL. Expect an INSERT into "users" with the columns "id", "name", "active" and "note", and the values (1, 'O''Brien', 1, NULL). The apostrophe is doubled inside the SQL string; it is still part of O’Brien’s name.

When is SQL INSERT Generator (All‑In‑One) useful?

For CSV or TSV, the first row supplies the column names; cells are read as text. A CSV cell containing 00123 therefore becomes a quoted SQL value, while a JSON number becomes numeric SQL. JSON null and missing properties become NULL; an empty CSV cell becomes an empty string. With JSON or JSONL, only the first record supplies column names: keys introduced in later records are not added. Use consistent fields across every record.

Example

Choose JSONL explicitly for newline-delimited objects: automatic detection can mistake JSONL for one JSON document. CSV/TSV support quoted delimiters, escaped double quotes and quoted line breaks, and reject duplicate or empty headers and inconsistent row widths. As an error example, choose CSV and enter id,id as the header: it must be rejected. Bulk Insert off produces one statement per row instead of a combined VALUES list. A selected Excel file takes precedence over pasted text and only its first sheet is read.

Practical notes

PostgreSQL booleans are emitted as TRUE/FALSE; the other dialect options use 1/0. Objects used as cell values become JSON text. JavaScript number precision applies to JSON and spreadsheet numbers, so keep large identifiers as strings. Copied table text has simpler splitting rules and is unsuitable for ambiguous empty or multiline cells. Check the target schema, date representation, constraints and database-specific settings before using the result. Generated SQL is editable text; the SQLite INSERT reference describes the example dialect. Processing stays in the browser; the Excel library is loaded from a CDN.