Insert million rows | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13

Insert million rows

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

4th Feb 2017, 2:27 AM
siddiq shameer
siddiq shameer - avatar
4 Answers
4th Feb 2017, 9:34 AM
Álvaro
+ 2
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.
16th Mar 2017, 7:09 PM
Dzung Le
Dzung Le - avatar
+ 1
i was making rainbow tables for my hashing algorithm and i stopped after 42,000
25th Mar 2017, 1:48 AM
Jon Hartway
Jon Hartway - avatar
0
search for bulk insert
2nd Apr 2017, 5:12 PM
Hakkı Karahan
Hakkı Karahan - avatar