Results 1 to 5 of 5

Thread: INSERT 1000000 post into DB

  1. #1

    Thread Starter
    Junior Member ost's Avatar
    Join Date
    Jan 2004
    Posts
    19

    INSERT 1000000 post into DB

    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?

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    A million entries in the table??? entered at once??? This may be more of a hardware or type of db issue. Maybe VB isn't the best language for this type of operation. C or ASM might be better suited. Heck, code straight to binary!
    Seriously, this may be beyond VB's capacity.
    If you can, rethink the design. Can the lines be INSERTed as they're generated, or as a smaller batch? Why do 1 million separate entries have to be inserted at once?

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    If it is a one time job i see no problem in taking 1h..is it going to be made everyday?
    \m/\m/

  4. #4

    Thread Starter
    Junior Member ost's Avatar
    Join Date
    Jan 2004
    Posts
    19
    it has to be done once a month...

    Its not a big problem but I rather do it quick than slow :-)

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    What kind of database are we talking about here? From what? To what? And why?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width