It is possible to use (BULK INSERT statement) to insert data from a temporary table to another table in the database ?
How can I use this operation since it has a temporary table more than 100,000 records?
Thanks
(sql server 2005)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A temp table with only 100,000 records should be inserted into another table in very quickly certainly not long enough to timeout. If you are having timeouts, you have a different problem. First check to see if you have triggers that run a cursor or loop, check to see if your import statement has any correlated subqueries which would cause it to run slowly and check to see if the data is indexed (you can index temp tables but not table varaibles). Look at your execution plan to see where the bottelneck lies.
Another option is to run in batches of 1000 – 10,000 at a time (you may want to experiment to see how big a batch you can get away with.)