Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

 

I have a textfile with 1000000 lines and i need to INSERT these into a database.

 

The keyword here is performance. I have tried to read a line and doing an INSERT for each line.. This means 1000000 executenonquery calls and it would take about 1 hour to do this import.

 

Anyone have other ideas on how to do this?

Posted

I'd have the program read all of the data from file into a dataset entirely (or in batches if its too much information) and then use the dataAdapter.update method to update more than one record at a time.

 

I don't know if behind the scenes, its really calling 1,000,000 INSERT statements. That may be the case.

 

Thats how I'd do it with my oleDB. I'm not sure about MSDB.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...