Re: Inserts so slow using _Connection.Execute
- From: "Viatcheslav V. Vassiliev" <support@xxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 11:50:14 +0400
The same can be done using IRowsetFastLoad interface.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Steve" <hughessatmdnationwide.co.uk> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:442cdd74@xxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for that, I will definitely look into this. It seems a good way to
do this. I will check out BOL as you say.
Many thanks for the tip
regards
steve
"Arnie" <none> wrote in message news:442c1b85$1@xxxxxxxxxxxxxxxxxxxxxxxxx
"Steve" <hughessatmdnationwide.co.uk> wrote in message
news:442b90ac@xxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for the input.
If I use bcp, don't I have to save the records to a text file first?
No. SQL Server has a BCP 'C' API. I use BCB and VS2005 so I can't
really five you a decent Delphi example. But, I'm sure Delphi can use C
functions from a DLL.
In general, as I said (more or less) previously, you have to describe
your column layout as a struct (record). You then read and modify your
source records as appropriate and add them to an array (std::vector in
C++). When done, you point a BCP API function to the array and say DO IT
for as many rows as you've accumulated. The entire n row insert is done
at once. If you can't fit all of the rows into memory at one time, the
inserts can be done in 'chunks' of 10,000, 20,000 rows or as many as you
can accomodate in memory. It is extremely fast though certainly more
trouble to code than doing one INSERT at a time. We typically insert
hundreds of thousands of rows in seconds.
As I said before, check out Books Online.
- Arnie
.
- References:
- Inserts so slow using _Connection.Execute
- From: Steve
- Re: Inserts so slow using _Connection.Execute
- From: Arnie
- Re: Inserts so slow using _Connection.Execute
- From: Steve
- Re: Inserts so slow using _Connection.Execute
- From: Arnie
- Re: Inserts so slow using _Connection.Execute
- From: Steve
- Inserts so slow using _Connection.Execute
- Prev by Date: Re: Inserts so slow using _Connection.Execute
- Next by Date: Re: How to verify if Access database exists...
- Previous by thread: Re: Inserts so slow using _Connection.Execute
- Next by thread: Re: Inserts so slow using _Connection.Execute
- Index(es):
Relevant Pages
|