Skip to main content
HandyWeb

CSV to SQL Converter

Turn a CSV file into INSERT and CREATE TABLE statements for MySQL, PostgreSQL, SQLite, or SQL Server. Column types are guessed from your data.

0 characters0 bytes
0 characters0 bytes

The column types are guessed from the data. Read the CREATE TABLE before you run it. Codes such as 007 stay text.

How to Use It

  1. Choose the database and the table name.
  2. Paste the CSV with its header row.
  3. Read the SQL, and copy or download it.

Questions and Answers

Why does the database matter?

Each database quotes names in its own way ("name", `name`, or [name]), and writes booleans and Unicode text differently.

Good to Know

The types are guessed from this data: integer, decimal, boolean, date, timestamp, or text. No primary key or index is made. The SQL is not run.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)