CSV a SQL INSERT
Genera sentencias SQL INSERT a partir de datos CSV. Útil para importar exportaciones CSV a bases de datos.
INSERT INTO my_table (name, value) VALUES ('A', '1');
INSERT INTO my_table (name, value) VALUES ('B', '2');Cómo usar esta herramienta
- 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.
¿Qué es CSV a SQL INSERT?
Importar CSV de forma masiva a una base de datos suele requerir sentencias INSERT. Este generador produce INSERT de SQL estándar que funcionan en MySQL, PostgreSQL, SQLite y la mayoría de los demás SGBD. Para CSV muy grandes (más de 10 000 filas), es preferible la utilidad nativa de tu base de datos (LOAD DATA / COPY FROM): es órdenes de magnitud más rápida.
Casos de uso comunes
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.
Preguntas frecuentes
¿Gestiona los caracteres especiales en los valores?▼
¿Y los valores NULL?▼
Herramientas relacionadas
Conversor de JSON a CSV
Convierte un array JSON de objetos a formato CSV. Perfecto para exportar datos de API a hojas de cálculo.
Conversor de CSV a JSON
Convierte datos CSV en un array JSON de objetos. La primera fila se trata como encabezado.
Conversor de Binario a Hexadecimal
Convierte números binarios a hexadecimal. El hexadecimal es 4 veces más compacto que el binario para el mismo valor.
Conversor de Hexadecimal a Binario
Convierte números hexadecimales a binario. Cada dígito hexadecimal se expande exactamente a 4 dígitos binarios.
Conversor de Decimal a Binario
Convierte números decimales a binario, hexadecimal y octal, todas las bases a la vez.
Conversor de ASCII a Hexadecimal
Convierte texto a códigos hexadecimales ASCII y viceversa. Cada carácter se convierte en su valor hexadecimal de 2 dígitos.