Convert to SQL

Convert large CSV and Excel files into optimized and awesome SQL import files, like a boss.

How Convert2SQL works


Convert2SQL makes csv and Excel spreadsheet conversions into SQL easy and fast. We aim to solve the mundane and time-consuming task that many Developers and DevOps face when having to move, store or migrate big data volumes into database server systems. C2S is a fast and efficient tool that free up the user so that they instead can use their talent where it is really needed.


The whole process consists of 5 stages



Upload

Select the csv or excel file and upload it to us. When this stage is completed the system takes over and leaves you to do other things.


Analyze

We go through each column and every row (yes, that's right. C2S is not lazy..) of your csv / spreadsheet to figure out what kind if table schema your csv / spreadsheet file needs. For example, if we detect that a column consists of decimal values, we check the length of each value and the length decimal value. After this we take the highest value we detected and uses that one for your column length definition (if applicable). If we detect multiple types, we'll try and find a middle ground, meaning a type that should work as optimal as possible for the detected types. If we are not able, C2S falls back and defines a string type column (based on size), we do this to minimize the risk of data truncation.


Conversion

We use that analyze csv / spreadsheet data and builds up your schema and builds up the SQL import dump with batched INSERT statements. We start a new INSERT statement per 1000 rows, we found that this threshold usually works best with multiple server types. If you also wanted a Laravel Migration file, we'll generate one for you too. The schema file is stored separately so it gives the user the option to modify it to fit his/her need before the import.


Delivery

The source file that was used in earlier stages is deleted for privacy.

We then create a zip-file of the following content:


README.md - Some tips and instructions 
schema.sql - Your SQL table schema file that you execute before importing the dump file.
dump.sql - The converted SQL dump file, containing the data of batched INSERT statements.

If you wanted a Laravel migration file, the migration php-file will also be included.


Notification

We send you the download link to your mail (please note that you must login with your C2S account in order to download it). You will also find it in your notification sidebar when logged in to C2S (The "bell" icon in navigation bar).

We store the converted SQL file for 24 hours, during that time you can download it. After that timeframe, it's deleted for privacy.



Basic example - CSV to SQL




Given, we recieve the following coma-separated data:


random_int,random_dec,random_sentence,datetime,foo,latitude,longitude
28220,56060457.11,"Rem asperiores ipsa omnis occaecati","1983-02-18 09:03:57","Foo bar baz",66.951634,-104.109409
22519,2.99,"Repellat soluta velit aut et.","1984-07-21 00:19:44","Baz bar foo",22.644856,-65.59038
8                    

C2S will convert it into (here for a MySQL vendor, with AI-PK option):


# The table schema file
CREATE TABLE my_import_table (
    id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, 
    random_int SMALLINT(6) UNSIGNED DEFAULT NULL,
    random_dec DECIMAL(10,2) DEFAULT NULL,
    random_sentence VARCHAR(35) DEFAULT NULL,
    datetime DATETIME DEFAULT NULL,
    foo VARCHAR(11) DEFAULT NULL,
    latitude DECIMAL(8,6) DEFAULT NULL,
    longitude DECIMAL(9,6) DEFAULT NULL,
    PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

# The SQL dump file
INSERT INTO my_import_table (random_int, random_dec, random_sentence, datetime, foo, latitude, longitude) VALUES 
(28220, 56060457.11, 'Rem asperiores ipsa omnis occaecati', '1983-02-18 09:03:57', 'Foo bar baz', 66.951634, -104.109409),
(22519, 2.99, 'Repellat soluta velit aut et.', '1984-07-21 00:19:44', 'Baz bar foo', 22.644856, -65.590388);
                    

And of course, if you picked a different vendor, we'll define a schema that works with that vendor.


That's it. Enjoy Convert2SQL!



If you have any questions, send us a message to support@convert2sql.com