Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Speed of adding new records


Message #1 by texter@o... on Mon, 1 May 2000 18:5:8
If speed is important (as you say it is) and you are working with a "big"
database, i.e. SQL Server, then you should use the BCP utility to import the
file to your database.  Usually you import into a temporary table, validate
the information there, and then perform something like:

	INSERT INTO MainTable SELECT * FROM TempTable WHERE Valid

This an order of magnitude quicker than individual addnew's.

I hope this helps.

Sincerely,

Dean Parkinson

> -----Original Message-----
> From: texter@o... [mailto:texter@o...]
> Sent: Sunday, April 30, 2000 7:00 PM
> To: professional vb
> Subject: [pro_vb] Speed of adding new records
>
>
> I am currently working on a program that involves an import routine.  All
> it does is take a file full of phone numbers, each phone number
> on its own
> line.  I have it setup to read the line, and it then imports the record.
> My question is, what is the speed difference between using the .AddNew
> method of a record set, or using a command object, and executing
> an Insert
> query?  Speed on this is fairly important, and so I'm looking for
> the most
> efficient way to do this.  Any help would be greatly appreciated.
>
> James
>


  Return to Index