Insert million rows | SoloLearn: Learn to code for FREE!


Insert million rows

how to insert million rows into a table at a time(stored procedure?)?

2/4/2017 2:27:21 AM

siddiq shameer

4 Answers

New Answer


Check 'load data infile':


Does your data come from a file or a table? You can do BULK INSERT to write all your data from a csv file for example to a staging table. This is only one line of code. However, you will have to define your staging table's columns to match the exact columns of your csv file. Once the data is imported to a table, this can be a table variable or a temp table and then you can insert the data into your designated table using this example command: insert into your_table name select * from staging_table. This will copy all rows in the staging table to the new table and then you may need to truncate or drop the staging table. Hope that helps, thanks.


i was making rainbow tables for my hashing algorithm and i stopped after 42,000


search for bulk insert