SQL INSERT Generator

Fill in the grid and get INSERT statements you can run. Quotes in your data are escaped, statements are batched so no single one becomes unmanageable, and you can generate a CREATE TABLE alongside them.

From

The only part of this site that uses a server. The address is sent to it so the page can be fetched, because a browser is not allowed to fetch someone else's page itself. Your own files are never involved.

Nothing here is uploaded. The parsing happens on this page.
Edit
Paste or upload something above and it will appear here.
ToDataMarkupDocumentsCodeSchemasImages

The output will appear here once there is a table to convert.

Inferred column types

Ask for a CREATE TABLE and each column gets a type worked out from the values in it. A column stays INT until something does not fit, then widens to DECIMAL, then to VARCHAR sized from the longest value present.

The inference is a starting point, not a schema review. It sees the rows you typed, not the rows that will arrive next year, so widen anything you know will grow before you run it.

Escaping and safety

Single quotes are doubled, which is how SQL escapes them, so a value like O'Brien becomes 'O''Brien' and runs correctly.

These statements are not parameterised. That is fine for a one-off import you are running yourself. It is not a pattern to copy into application code that handles input from anyone else, where the query and the data must stay separate.

Questions

Which database dialect is this?

Close to MySQL: identifiers are wrapped in backticks. For PostgreSQL or SQL Server, replace the backticks with double quotes or square brackets. The VALUES clauses are standard and need no change.

Why are the statements split into batches?

A single INSERT holding fifty thousand tuples is legal and many clients refuse it, either through a packet size limit or by running out of memory building the query. The default is a hundred rows per statement, adjustable in the options.

Already have the data somewhere else?

Other generators