広告が嫌いですか? 行く 広告なし 今日

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文を変換するツール

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?

This converter automatically escapes special characters according to each database dialect. Single quotes in string values are doubled (O’Brien becomes O”Brien). Backslashes are escaped where required. Column names with spaces or reserved words are properly quoted using the dialect’s identifier quoting: backticks for MySQL, double quotes for PostgreSQL/SQLite/Oracle, and brackets for SQL Server. Embedded commas and newlines in CSV fields are handled by the RFC 4180 parser.

What is the difference between individual and batch INSERT?

Individual INSERT generates one INSERT statement per CSV row — simple but slower for large datasets. Batch INSERT combines multiple rows into a single statement: INSERT INTO table VALUES (…), (…), (…). This is significantly faster because it reduces the number of database round-trips. Most databases support batch INSERT with some limits: SQL Server allows up to 1000 rows per INSERT, while MySQL, PostgreSQL, and SQLite have no fixed row limit but may hit packet size limits. Oracle uses a different syntax: INSERT ALL … INTO … SELECT FROM dual.

How does type detection work?

The converter examines each column’s values to infer the type. Values matching integer patterns (digits only, optional minus) are typed as INTEGER. Decimal numbers become FLOAT or DECIMAL. True/false and yes/no values become BOOLEAN. Empty cells and ‘NULL’ text become SQL NULL (configurable). Everything else is treated as a string (VARCHAR). You can override any detected type in the column preview before generating SQL. Type detection affects both the VALUES quoting (numbers unquoted, strings quoted) and the optional CREATE TABLE column definitions.

Is my CSV data sent to a server?

No — all CSV parsing, type detection, SQL generation, and escaping happen entirely in your browser using JavaScript. Your data never leaves your device. This is important because CSV data often contains sensitive information: customer records, financial data, credentials, or internal business data. All processing runs client-side with no API calls or data storage.

広告なしで楽しみたいですか? 今すぐ広告なしで

拡張機能をインストールする

お気に入りのブラウザにIOツールを追加して、すぐにアクセスし、検索を高速化します。

に追加 Chrome拡張機能 に追加 エッジ拡張 に追加 Firefox 拡張機能 に追加 Opera 拡張機能

スコアボードが到着しました!

スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!

ニュースコーナー 技術ハイライト付き

参加する

価値ある無料ツールの提供を継続するためにご協力ください

コーヒーを買って