CSVからSQL INSERT文を変換するツール
データベースの場合のINSERT文の書式
| データベース | アイデンティファイヤー・クォート | Batch INSERT |
|---|---|---|
| MySQL | `column` | INSERT INTO t VALUES (...), (...) |
| PostgreSQL | "column" | INSERT INTO t VALUES (...), (...) |
| SQLite | "column" | INSERT INTO t VALUES (...), (...) |
| SQL Server | [column] | INSERT INTO t VALUES (...), (...) ご利用にあたっての注意事項や制限が適用されます。 |
| オラクル | "column" | INSERT ALL INTO t VALUES (...) ... SELECT 1 FROM DUAL |
脱出ルール
- シングルクォートは文字列内で二重に記述されます。
'it''s' - MySQL バックティック識別子:
`my column` - SQL サーバーの括弧識別子:
[my column] - PostgreSQL/SQLite/Oracle の引数のダブルクォート記号:
"my column"
コモン・ゴッチャス
- CSVフィールド内のカンマは二重引用符で囲む必要があります。
- ダブルクォート(引用符)が引用されたフィールド内では、二重にエスケープされます。
"" - 空欄はコンテキストに応じてNULLまたは空の文字列を表すことがあります。
- 日付形式はデータベースごとに異なります — データベースのフォーマットに合わせて日付列を確認してください。
- SQL サーバーは、1つのステートメントごとに最大1,000行までのINSERT バッチを制限しています。
- オラクルは標準的な複数行のINSERTをサポートしていません。代わりにINSERT ALL構文を使用します。
ガイド
CSVからSQL INSERT文を変換するツール
Convert CSV data to SQL INSERT statements for MySQL, PostgreSQL, SQLite, SQL Server, and Oracle. Paste your CSV with column headers, configure options like batch inserts and type detection, and get properly escaped SQL ready to execute. Handles quoted fields, embedded commas, NULL values, and dialect-specific escaping.
使用方法
Paste CSV data into the input area (first row must be column headers). Select your target database flavor, set a table name, and choose your INSERT style (individual, batch, or chunked). The converter auto-detects column types and generates properly escaped SQL instantly. Review detected columns in the preview, override types if needed, and copy or download the SQL output. Optionally include a CREATE TABLE statement or transaction wrapper.
機能
- 5 Database Flavors — MySQL (backtick identifiers), PostgreSQL (double-quote identifiers), SQLite (double-quote), SQL Server (bracket identifiers), and Oracle (INSERT ALL syntax). Each with correct escaping and quoting rules.
- Batch INSERT — Individual INSERT per row, multi-row batch INSERT with VALUES clauses, or configurable chunk size. SQL Server auto-limits to 1000 rows per statement. Oracle uses INSERT ALL … SELECT FROM dual.
- Auto Type Detection — Automatically identifies integers, floats, booleans, NULLs, and strings from your data. Numbers are unquoted, strings are properly escaped and quoted, NULLs are literal NULL.
- Column Editor — Preview detected columns with names, types, and sample values. Rename columns and override type detection before generating SQL.
- NULL Handling — Configure how empty values are treated: as SQL NULL, as empty strings, or detect “NULL” text as actual NULL values.
- CREATE TABLE — Optionally prepend a CREATE TABLE statement with inferred column types mapped to each database dialect (VARCHAR, INT, DECIMAL, BOOLEAN, etc.).
- Transaction Wrapper — Optionally wrap output in BEGIN/COMMIT for atomic execution.
- RFC 4180 CSV Parsing — Handles quoted fields with embedded commas, escaped quotes, and newlines within fields. Auto-detects delimiter (comma, tab, semicolon, pipe).
SQL INSERT Syntax
The SQL INSERT statement adds rows to a database table. The basic syntax is: INSERT INTO table_name (column1, column2) VALUES ('value1', 'value2'); String values must be properly escaped — single quotes within values are doubled (O’Brien becomes O”Brien). Numeric values are inserted without quotes. NULL is a keyword, not a string. Batch inserts combine multiple rows in a single statement for better performance: INSERT INTO table VALUES (...), (...), (...);
How do I handle special characters in CSV to SQL conversion?
What is the difference between individual and batch INSERT?
How does type detection work?
Is my CSV data sent to a server?
恵 スコアボードが到着しました!
スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!
