Ravi Kiran Va wrote:
insert 1 million record
I bet this will be not easy .
As a thumb rule you shouldn't insert so many records at a single instance .
You need to make them into different batches of data and deal with them .
Thank you very much for the reply!
This afternoon, I have spent some time to see if I can speed up based on some methods that I found.
Currently, i have learnt that I can speed up with the following method:
1: within the while loop, I write the resultset into a txt file.
2: then with the txt file, I use BulkInsert funtion to load this txt file into table B
In this way, the time has been reduced dramatically: the
exchange from DB to txt cost me around 1 minutes, and to send the txt file back to the DB is only around 40 seconds.
The total time now in my opinion is good.
But if anyone has some more faster method, please let me know!
Thank you!