Da CSV a SQL INSERT
Genera istruzioni SQL INSERT a partire da dati CSV. Utile per importare esportazioni CSV nei database.
INSERT INTO my_table (name, value) VALUES ('A', '1');
INSERT INTO my_table (name, value) VALUES ('B', '2');Come usare questo strumento
- 1
Type the destination table name into the top field (it is dropped into the generated INSERT exactly as typed).
- 2
Paste your CSV into the text box, keeping the header row first so its names become the column list.
- 3
Read the INSERT statements that appear below as you type, with one statement per data row.
- 4
Select the generated SQL and copy it into your database client or migration script to run it.
Che cos'è la conversione da CSV a SQL INSERT?
L'importazione massiva di file CSV in un database richiede solitamente istruzioni INSERT. Questo generatore produce istruzioni INSERT in SQL standard che funzionano in MySQL, PostgreSQL, SQLite e nella maggior parte degli altri DBMS. Per file CSV molto grandi (oltre 10.000 righe), è preferibile l'utilità nativa del suo database (LOAD DATA / COPY FROM): è più veloce di diversi ordini di grandezza.
Casi d'uso comuni
Seeding a few rows of test or fixture data into a local development database without writing the INSERTs by hand.
Converting a small spreadsheet export of lookup values (statuses, categories, country codes) into a migration script.
Drafting INSERT statements for a quick demo or tutorial where the data is short and contains no commas inside fields.
Reshaping a handful of rows copied from a CSV file into SQL you can paste into a query console.
Generating a starting point for a data-load script that you will then hand-edit to add NULLs or fix column types.
Teaching or learning SQL INSERT syntax by watching how column lists and quoted values are assembled from rows.
Domande frequenti
Gestisce i caratteri speciali nei valori?▼
E i valori NULL?▼
Strumenti correlati
Convertitore da JSON a CSV
Converte un array JSON di oggetti in formato CSV. Perfetto per esportare dati API in fogli di calcolo.
Convertitore da CSV a JSON
Converte i dati CSV in un array JSON di oggetti. La prima riga viene trattata come intestazione.
Convertitore da binario a esadecimale
Converte i numeri binari in esadecimale. L'esadecimale è 4 volte più compatto del binario per lo stesso valore.
Convertitore da esadecimale a binario
Converte i numeri esadecimali in binario. Ogni cifra esadecimale si espande esattamente in 4 cifre binarie.
Convertitore da decimale a binario
Converte numeri decimali in binario, esadecimale e ottale, tutte le basi contemporaneamente.
Convertitore da ASCII a esadecimale
Converte il testo in codici esadecimali ASCII e viceversa. Ogni carattere viene convertito nel suo valore esadecimale a 2 cifre.