Re: Inserts so slow using _Connection.Execute
- From: "Arnie" <none>
- Date: Thu, 30 Mar 2006 12:56:30 -0500
"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
.
- Follow-Ups:
- Re: Inserts so slow using _Connection.Execute
- From: Steve
- Re: Inserts so slow using _Connection.Execute
- 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
- Inserts so slow using _Connection.Execute
- Prev by Date: Re: Automating DTS conversion?
- Next by Date: 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
|