How to use Table to SQL Insert Generator
- Paste a table with headings, or clear the text box and choose a CSV, TSV or XLSX file. For XLSX, select the worksheet if the first visible one is not the intended source.
- Choose the destination dialect and table identifier. Map column types explicitly; enable simple type detection only for unmapped columns you want inspected.
- Choose Insert or Upsert, the batch size and whether empty cells become SQL NULL. For upsert, review the destination's actual primary/unique keys and the conflict-key headings.
- Optionally request a starter CREATE TABLE, then review its approximate numeric types and missing constraints. Download the SQL and test it against a disposable database before using it on real records.
Example: Table to SQL Insert Generator
Generate two typed INSERT statements without a CREATE TABLE statement.
Options
- Source table
- A heading row and up to 100,000 data rows. Clear this box to choose a file.
- XLSX worksheet
- Optional worksheet name or 1-based number. Blank uses the first visible worksheet.
- Destination table name
- One table identifier, not a SQL expression or a schema-qualified path.
- Column types JSON
- Map headings to text, number or boolean. Unlisted columns remain text, including leading zeroes.
- Detect unlisted column types
- Numbers up to 15 digits and true/false columns. Leading-zero identifiers and mixed columns stay text; explicit types take precedence.
- MySQL / MariaDB text literals
- Both choices preserve text across SQL modes. Other dialects use their own quoted text.
- Include a starter CREATE TABLE
- Uses TEXT, BOOLEAN/INTEGER and DOUBLE PRECISION. Review numeric precision, constraints and keys before executing; upsert keys are not created.
- Rows per statement
- Group 1 to 500 rows into each INSERT statement. The final group may contain fewer rows.
- Upsert conflict-key headings
- Comma-separated headings. PostgreSQL/SQLite need an existing matching unique key. MySQL/MariaDB reacts to any primary or unique key.
Supported inputs and limits
- Source up to 20 MiB, 100,000 rows, 500 columns and 2,000,000 cells;
- SQL up to 10 MiB.
- Detect unlisted simple numbers/booleans only when selected; leading-zero IDs and mixed/long numeric text remain text.
- Readable MySQL/MariaDB text falls back to UTF-8 hex for backslashes/control characters; an all-hex option remains.
- Starter CREATE TABLE uses TEXT, Boolean/INTEGER and approximate DOUBLE PRECISION, without keys/constraints.
More details
Review destination precision and keys.
Batch size: 1–500.
No database is contacted.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
Generated SQL still needs a target-schema review
The tool formats entered table values; it does not connect to a database, create the target table or verify its constraints. Check column types, identifiers, null handling and the intended conflict behavior before execution. Try the script on a disposable copy when replacing real records.
A type declaration changes how a value is written
A numeric mapping emits numeric values, while text mappings quote strings. Applying a number type to an identifier can remove a meaningful text convention or reject the value. Keep a source export and review a few statements containing blanks, quotes and formula-like text.
Questions about Table to SQL Insert Generator
Does this import into my database?
No. It creates SQL text. Review it and use your own database tools when ready.
Will numbers be guessed from the CSV?
Only when Detect unlisted column types is enabled. It detects supported simple numbers and true/false values for unmapped columns; explicit mappings take precedence. Leading-zero IDs, long numeric strings and mixed columns stay text. Leave detection off when you need every type chosen explicitly.
Why must I choose conflict columns?
PostgreSQL and SQLite upserts need a conflict target. The tool cannot discover or create your destination constraints.