CSV → SQL INSERT 生成器
免费在线 CSV 转 SQL INSERT 工具:粘贴 / 拖拽 CSV 自动识别分隔符(逗号/Tab/分号/竖线),智能推断列类型(INT / DECIMAL / DATE / DATETIME / BOOLEAN / VARCHAR),可选生成 CREATE TABLE,支持 MySQL / PostgreSQL / SQLite / SQL Server 多方言、批次拆分、空值处理。所有处理在浏览器本地完成
Click or drop a .csv file
CREATE TABLE `imported_data` (
`id` TINYINT NOT NULL,
`name` VARCHAR(16) NOT NULL,
`email` VARCHAR(32) NOT NULL,
`age` TINYINT NULL,
`signup_at` DATETIME NOT NULL,
`is_active` BOOLEAN NOT NULL,
`note` VARCHAR(32) NULL
);
INSERT INTO `imported_data` (`id`, `name`, `email`, `age`, `signup_at`, `is_active`, `note`) VALUES
(1, 'Alice', 'alice@example.com', 30, '2024-01-15 10:30:00', 1, 'Hello, world'),
(2, 'Bob', 'bob@example.com', 25, '2024-02-20 09:00:00', 0, 'with "quote" inside'),
(3, '小明', 'xiaoming@test.com', NULL, '2024-03-01 14:00:00', 1, '中文测试'),
(4, 'Eve', 'eve@example.com', 28, '2024-04-01 12:00:00', 0, NULL);
User Guide
✨ Features
• RFC 4180 compliant CSV parser — handles quoted fields, embedded newlines, '' escaping • Auto-detects delimiter: comma / Tab / semicolon / pipe (manual override available) • Smart column type inference: TINYINT / SMALLINT / INT / BIGINT / DECIMAL / DATE / DATETIME / BOOLEAN / VARCHAR(N) / TEXT / EMAIL / UUID • Optional CREATE TABLE generation with NULL / NOT NULL annotations • Four dialects: MySQL / PostgreSQL / SQLite / SQL Server, each with the right identifier-quoting style • Batch splitting: max N rows per INSERT (default 500), avoids over-large statements • Live data preview (first 10 rows) + type chips + line-numbered error messages • Drag-and-drop upload / paste / download .sql file • All processing local in your browser — CSV never leaves your device
📖 How to Use
Step 1
Paste CSV text or drop a .csv file into the upload area
Step 2
Configure: table name, dialect, delimiter (auto-detect), include CREATE TABLE
Step 3
The right pane shows generated SQL live; below shows inferred column types and a data preview
Step 4
Click 'Download SQL' to save, or 'Copy' to paste into your client
Like it? Rate it!