CSV to SQL Converter
Instantly convert CSV data to SQL INSERT/UPDATE statements
in your browser securely and for free.
Configuración de Tabla
Opciones
CSV de Entrada
SQL de Salida
También te puede interesar
Acerca del Convertidor CSV a SQL
Esta es una herramienta gratuita para que los desarrolladores generen instantáneamente sentencias SQL INSERT o UPDATE a partir de archivos CSV. Ahorre tiempo y reduzca errores humanos al migrar datos de Excel a una base de datos.
El proceso de conversión se realiza completamente en su navegador. Incluso si el archivo CSV contiene información sensible, nunca se enviará a un servidor externo, permitiéndole generar SQL de forma segura.
Cómo convertir CSV a SQL
Introducir Configuración
Seleccione el nombre de la tabla y el tipo de SQL (INSERT o UPDATE) y ajuste las opciones.
Preparar Datos CSV
Pegue los datos CSV directamente en el área de texto o cargue un archivo. Active la opción si usa la primera fila como nombres de columnas.
Generar y Copiar SQL
Haga clic en el botón 'Generar SQL' y las sentencias se crearán instantáneamente. Copie el resultado para ejecutarlo.
Glosario de SQL y Bases de Datos
- CSV (Valores Separados por Comas)
- Formato de texto simple que usa comas para separar valores.
- SQL (Lenguaje de Consulta Estructurada)
- Lenguaje de programación estándar para definir y manipular datos en bases de datos relacionales.
- Sentencia INSERT
- Comando SQL para añadir nuevas filas a una tabla. La herramienta soporta la inserción masiva.
- Sentencia UPDATE
- Comando SQL utilizado para modificar registros existentes, generalmente combinado con una cláusula WHERE.
- Escapado
- Proceso para garantizar que los caracteres especiales en SQL (como comillas simples) sean tratados como cadenas.
Preguntas Frecuentes
- Q.Is the CSV data I enter saved on external servers?
- No, all input data is processed strictly within your PC or smartphone's browser. There is no transmission or storage of data to external servers, making it completely safe to use even with CSV files containing customer lists or sensitive information.
- Q.Can it convert huge CSV files with tens of thousands of rows?
- Yes, it can, but it depends on your browser's memory and processing power. Processing a few thousand to tens of thousands of rows usually completes in seconds. However, for extremely large files exceeding 100,000 rows, we recommend splitting the file before conversion to prevent browser freezing.
- Q.How are numeric and string data distinguished?
- The tool automatically analyzes the value of each cell internally. If it consists only of numbers (or numbers with a decimal point), it is treated as a number and quotes are removed. This automatic inference can also be disabled in the options, allowing you to force all values to be quoted as strings if required.
- Q.How are NULL values or empty cells handled?
- Empty cells or the string 'NULL' are output to SQL as `NULL` without quotes so that they are treated as official NULLs in the database. If you intentionally want them registered as empty strings (`''`), please adjust the CSV data beforehand or manually tweak the generated SQL.
- Q.Can I use the output with both MySQL and PostgreSQL?
- Yes, the basic INSERT and UPDATE statements are generated using standard SQL syntax, so you can use them directly in major relational databases like MySQL, PostgreSQL, SQLite, and SQL Server. If specific functions or dialects are required, please replace them in the output SQL using a text editor.
Casos de uso
Población Inicial de Datos
Útil para generar sentencias INSERT al cargar datos iniciales creados en Excel.
Actualizaciones Masivas
Cree sentencias UPDATE rápidamente para sobrescribir tablas usando datos actualizados.
Migración de Datos
Ayuda a importar archivos CSV exportados de sistemas antiguos convirtiéndolos en SQL.
Creación de Parches
Conveniente cuando los datos están corruptos y necesita crear SQL de parche de recuperación rápida y precisa.
Enviar comentarios
Déjenos saber su opinión para ayudarnos a mejorar la herramienta.
Los comentarios están temporalmente suspendidos
El servidor está ocupado o la protección contra spam está activa. Inténtelo más tarde.