Generate INSERT Statements from Excel: Bulk SQL Script Export

2026-07-01

Why convert Excel to INSERT scripts

Seed data for test environments, config imports, and backfilling from exports all need bulk INSERT statements. Writing them by hand is slow and error-prone—one missed quote breaks the whole script.

ComTools Excel to SQL is a free online tool: upload .xlsx or .csv, map columns, and generate INSERT scripts you can copy or download as .sql.

Prepare your Excel or CSV file

Requirement Details
Row 1 Column headers, e.g. UserId, Email, Age
Data rows One INSERT per row starting from row 2
Column names Match DB fields when possible; remap in the tool
Formats .xlsx, .xlsm, .csv

Example:

UserId Email Age
1001 alice@example.com 28
1002 bob@example.com 32

Steps (INSERT)

  1. Open Excel to SQL.
  2. Upload your file; pick the target sheet if there are multiple.
  3. Set statement type to Insert.
  4. Enter the table name, e.g. dbo.Users or users.
  5. Choose database type: SQL Server, MySQL, PostgreSQL, SQLite, or Oracle.
  6. In the column grid, select columns to include and adjust target field names.
  7. Optional: Batch INSERT (on by default—merges ~500 rows per statement for faster execution).
  8. Optional: Include CREATE TABLE for new or temp tables.
  9. Click Generate, then copy or download the SQL.

Single-row INSERT example

INSERT INTO dbo.Users (UserId, Email, Age) VALUES (1001, 'alice@example.com', 28);
INSERT INTO dbo.Users (UserId, Email, Age) VALUES (1002, 'bob@example.com', 32);

Batch INSERT example

INSERT INTO dbo.Users (UserId, Email, Age) VALUES
(1001, 'alice@example.com', 28),
(1002, 'bob@example.com', 32);

Single quotes in strings are escaped automatically; empty cells may become NULL depending on column inference.

Common scenarios

Scenario Suggested settings
Brand-new table Enable Include CREATE TABLE + Insert
Large import Keep Batch INSERT on; execute in chunks in your DB
Quick preview Use a temp name like #Preview—tool adds CREATE, INSERT, and SELECT
Data from a web table HTML to Excel first, then this tool
Multiple files MergeDedup → Excel to SQL

Execute in your database

USE YourDatabase;
GO
-- paste generated INSERT statements

Tips:

  • Run on a test database first; verify row counts.
  • Even with batch mode, commit in chunks of 500–1000 rows when scripts are huge.
  • Back up tables before production imports.

Other entry points

Source Tool
Excel / CSV Excel to SQL
JSON array (API) JSON to SQL
Pasted JSON rows Generate INSERT

Excel to SQL series

FAQ

How many rows are supported?
Up to 50,000 rows per generation; split very large files if needed.

CSV encoding issues?
Save as UTF-8 when possible; use CSV to Excel to inspect garbled files before generating SQL.

Is my file stored on the server?
The file is parsed server-side to produce SQL. Avoid uploading sensitive production data to untrusted hosts; use test data when possible.

INSERT vs UPDATE?
INSERT adds new rows; UPDATE changes existing rows by WHERE keys. For bulk email or status fixes, see the UPDATE guide.


中文版