OpenToolDesk.
English
Excel & CSV

CSV to SQL INSERT statements

Convert a CSV file into a downloadable SQLite or PostgreSQL script with CREATE TABLE and INSERT statements. Keep every value as text, or explicitly export blank cells as NULL.

Settings · CSV to SQL INSERT statements

Upload a file

Drag and drop files here

CSV

One file · 5 MB per file

Use a direct public file link up to 20 MB, or the smaller limit shown above. The download service retrieves the file; sign-in links are not supported.

    Download an example file

    or

    CSV input

    Paste text or upload a file. If you select a file, it takes priority.

    CSV to SQL INSERT statements

    Need a small CSV dataset in a SQL sandbox or test database? Upload a CSV and generate a readable SQL file for SQLite or PostgreSQL. Every source column becomes TEXT so identifiers such as 001 keep their leading zeroes. Choose whether blank cells mean empty strings or NULL, and whether the target table should be created. Check the resulting script and your target database before running it.

    How to use this tool

    1. Upload a UTF-8 CSV, drop it onto the upload area, import a direct public CSV URL, or paste a short example after the upload options.
    2. Choose SQLite or PostgreSQL, enter the table name, and decide whether to create a TEXT table and how blank CSV cells should be written.
    3. Download csv-inserts.sql. Review its CREATE TABLE statement and INSERT values before executing it in your database.

    Supported input formats

    • CSV

    Available settings

    • SQL table name
    • SQL dialectSQLitePostgreSQL
    • CREATE TABLE statementInclude CREATE TABLEINSERT statements only
    • Blank CSV cellsEmpty textSQL NULL

    Output and limitations

    Convert a CSV file into a downloadable SQLite or PostgreSQL script with CREATE TABLE and INSERT statements. Keep every value as text, or explicitly export blank cells as NULL.

    Upload one UTF-8 comma-separated CSV up to 5 MB, 10,000 data rows and 100 columns, or paste up to 12,000 characters. Choose SQLite or PostgreSQL, a simple table name and whether to include CREATE TABLE. Every column is declared TEXT; data types are not inferred. Blank cells become empty strings unless you select NULL. Single quotes, backslashes and quoted CSV fields are escaped for the selected dialect. The SQL output is limited to 20 MB. The tool does not connect to a database or execute the script. Review the generated SQL and target schema before importing. MySQL, existing-table type mapping and XLSX are unsupported.

    Is the generated SQL run automatically or safe for any database?

    No SQL is executed or uploaded to a database. The script targets the selected SQLite or PostgreSQL syntax only. Quotes and backslashes are escaped, but you should inspect the output, choose the correct table, and test an import in a disposable database before running it on important data.

    Does the converter detect numbers and dates?

    No. Every generated column is TEXT and every nonblank CSV cell is a quoted text value. This preserves leading zeroes and avoids guessing types from a small sample. Change the schema or import method if your database needs numeric or date columns.

    What if processing fails?

    Check the supported formats and file limits, then try a smaller file. Keep an original copy. A clear error message will explain an unsupported input or an unavailable processing service.