How to Convert Excel to SQL INSERT Statements: Step-by-Step
📊 Jump straight in: Open the Excel to SQL INSERT Generator and follow along.
Open Tool →This tutorial walks you through converting an Excel spreadsheet into a ready-to-run SQL INSERT script using the free Excel to SQL INSERT Generator. The entire process takes about 30 seconds. No software to install, no accounts to create, and your data never leaves your browser.
Table of Contents
1 Open the Tool and Drop Your File
Navigate to the Excel to SQL INSERT Generator. You'll see a drop zone in the center of the page. Either drag your .xlsx file directly onto it, or click to open your system file browser and select the file.
The tool accepts .xlsx, .xls, and .csv files. As soon as the file is loaded, the tool parses it and shows you the configuration options.
2 Select the Sheet
If your workbook has multiple sheets, use the Sheet dropdown to choose which one to convert. The tool automatically sets the target table name to match the sheet name (sanitized for SQL — spaces become underscores, special characters are removed).
A data preview appears below the options showing the first 8 rows with detected column types. Check that the types look reasonable — if a column you expect to be numeric shows as VARCHAR, there may be non-numeric values in your data.
3 Choose Your SQL Dialect
Select the target database from the SQL Dialect dropdown:
- MySQL — uses backtick quoting and MySQL-specific types
- PostgreSQL — uses double-quote identifiers and PostgreSQL types
- SQL Server (T-SQL) — uses bracket quoting, N-prefixed strings, and SQL Server types
- SQLite — uses simplified typing appropriate for SQLite's dynamic type system
4 Configure Options
Set the remaining options:
- Table Name — the name used in the INSERT and CREATE TABLE statements. Edit this to match your actual target table.
- Batch Size — how many rows per INSERT statement (default 1000). For SQL Server, individual INSERTs are generated regardless of this setting.
- First row is header — when checked, the first row becomes column names. Uncheck if your data starts in row 1 with no headers.
- Generate CREATE TABLE — when checked, a CREATE TABLE statement is prepended with inferred column types.
- Wrap in transaction — when checked, the script is wrapped in BEGIN/COMMIT for atomicity.
5 Generate the SQL
Click the blue Generate SQL button. The tool processes every row in the sheet and builds the SQL script. A progress bar shows the status. For most files (under 50K rows), this takes less than a second.
The output appears in a syntax-highlighted text area below the button, with a summary line showing row count, column count, dialect, and script size.
6 Copy or Download
Two options for getting your script:
- Copy — copies the entire SQL script to your clipboard, ready to paste into SSMS, pgAdmin, MySQL Workbench, or any SQL client.
- Download .sql — saves the script as a
.sqlfile named after your table.
Example Output
Given an Excel sheet named "employees" with columns id, name, email, and hire_date, with SQL Server selected and CREATE TABLE enabled, the output looks like:
CREATE TABLE [employees] (
[id] INT,
[name] NVARCHAR(255),
[email] NVARCHAR(255),
[hire_date] DATE
);
INSERT INTO [employees] ([id], [name], [email], [hire_date]) VALUES (1, N'Alice Johnson', N'[email protected]', '2024-03-15');
INSERT INTO [employees] ([id], [name], [email], [hire_date]) VALUES (2, N'Bob O''Brien', N'[email protected]', '2024-06-01');
INSERT INTO [employees] ([id], [name], [email], [hire_date]) VALUES (3, N'Carol Chen', N'[email protected]', '2025-01-10');
Note how O'Brien is automatically escaped to O''Brien, and string literals use the N'...' prefix for SQL Server Unicode support.
Tip: For the deepest coverage of type inference, dialect differences, and edge cases, read the companion Excel to SQL INSERT: A Complete Guide.
📊 Ready to try it? Drop an Excel file and generate SQL INSERT statements — free, browser-based.
Open Tool →