About Excel to SQL
Excel to SQL saves you from hand-writing INSERT statements when a spreadsheet needs to go into a database: a price list for a shop, test data, a lookup table from the finance team. Upload an XLSX, XLS or CSV file, pick MySQL, PostgreSQL, SQLite, SQL Server or Oracle, and you get a script you can run as is. For data that comes as JSON, JSON to SQL writes the INSERT statements in your browser.
The header row becomes the column names, with spaces turned into underscores and each name quoted the way your database expects. With Include CREATE TABLE on, column types are chosen from the data: integers, decimals, DATE, DATETIME, BOOLEAN or text sized to the longest value. Rows go in batches of 100 per INSERT by default, text is escaped properly, and empty cells become NULL.
How to use Excel to SQL
- 1Upload the spreadsheet
Choose or drop an .xlsx, .xls or .csv file with column names in the first row.
- 2Choose database and table
Pick your Database, type a Table name and decide on Include CREATE TABLE. Rows per INSERT is under More options.
- 3Click Excel to SQL
The script is generated on our server, and every sheet gets its own table.
- 4Copy or download
Copy the script from the result box or download the .sql file.
Why use Cubfile for this
- Five SQL dialects
Backticks for MySQL, brackets for SQL Server, double quotes elsewhere, plus INSERT ALL for Oracle.
- Column types from your data
Whole numbers, decimals, dates, true/false and text each get a fitting type.
- Safe values
Quotes are doubled, backslashes are escaped for MySQL and non-ASCII text gets the N prefix in SQL Server.
- Batched inserts
Choose how many rows go into each INSERT, up to 1,000, to suit your database's limits.