Toolvore

SQL INSERT to CSV

Extract rows from a supported explicit-column INSERT VALUES subset, retain number spelling and distinguish SQL NULL from empty text.

This tool processes its input contents in your browser instead of sending them to a processing service. Page, asset and fixed usage-measurement requests are described on the Privacy page.

Read a restricted explicit-column INSERT VALUES script into CSV without executing SQL, keeping literal numeric text and a distinct NULL marker.

How to use it

  1. 1Paste supported explicit-column INSERT statements for one table.
  2. 2Review the NULL marker and spreadsheet formula protection.
  3. 3Extract literal rows, then inspect and download CSV.

Example

Input
INSERT INTO people (id,name) VALUES (17,'O''Brien');
Output
id,name 17,O'Brien

The doubled SQL apostrophe becomes one logical cell character; no statement is executed.

What happens to your data

A bounded local scanner reads SQL text as data only. It has no database connection, credentials or statement executor; extracted rows remain in the browser until you choose an export.

Last updated November 2026

Extract literal table rows from copied SQL INSERT statements without connecting to a database. The accepted form includes a table name, explicit column names and VALUES tuples. It is designed for reviewed portable inserts, not a general database dump or a SQL execution environment.

How it works

All statements must identify the same table and identical column order, and end with semicolons. Standard single-quoted strings use doubled apostrophes; commas, semicolons and line breaks inside such strings remain data. Simple or double-quoted identifiers are supported. Unquoted identifiers are normalized to lowercase using PostgreSQL-style rules. Bare decimal numeric spelling is retained, as are leading zeros; booleans become lowercase true/false text.

NULL is represented by the explicit marker you choose, default NULL. If that marker also occurs as a non-NULL literal, conversion stops so empty text, null and a genuine marker string are not silently confused. Expressions, SELECT, casts, functions, comments, backslash/dollar-quoted dialects and other commands are rejected. The parser never executes SQL or contacts a database. A pg_dump file containing CREATE or SET statements must be reduced to the supported inserts first; not every SQL dialect/export is accepted.

CSV output uses UTF-8 without BOM and CRLF endings. Up to 500 KiB input, 10,000 records including the header, 128 columns, 200,000 cells and 2 MiB output. Spreadsheet formula protection is enabled by default and visibly prefixes formula-like cells and headers with an apostrophe. You can deliberately disable it for literal output; spreadsheet software may then execute formula-like strings. A header collision introduced by protection fails. No numeric/date coercion is performed.

Worked example: SQL INSERT to CSV example

Input
INSERT INTO people (id,name) VALUES (17,'O''Brien');
Result
id,name 17,O'Brien

The doubled SQL apostrophe becomes one logical cell character; no statement is executed.

Common use cases

  • Inspect literal records from an explicit-column SQL export.
  • Move a small reviewed insert fixture into a CSV-based test workflow.
  • Recover exact text fields without loading a database.

Frequently asked questions

Can I upload an entire SQL dump?+

Only if it contains nothing beyond the supported INSERT subset. CREATE, SET, COPY, comments, expressions and vendor-specific constructs fail clearly.

Are large numeric IDs rounded?+

Numeric literals are exported as text with their source spelling. A spreadsheet can still coerce them when opened; import the column as text.

How are NULL and empty strings distinguished?+

NULL uses your marker while an empty quoted string stays empty. Marker collisions with non-NULL data are rejected.