Bulk insertion of data in sql server
-
Hi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database (sql server 2005). Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database using sql server 2005? thanks montu3377
-
Hi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database (sql server 2005). Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database using sql server 2005? thanks montu3377
You can Bulk insert (using BCP or managed SqlBulkCopy) the text file contents to a table and use a stored proc to do read from that table and insert/update into the target table.