Re: Inserts so slow using _Connection.Execute



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





.



Relevant Pages

  • Re: FTS Performance in SQL 2005
    ... we had no end of problems with SQL FTS. ... Looking for a SQL Server replication book? ... The Memory Usage and VM Size never increase over about 65 MB and 20MB. ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: FTS Performance in SQL 2005
    ... we had no end of problems with SQL FTS. ... Looking for a SQL Server replication book? ... The Memory Usage and VM Size never increase over about 65 MB and 20MB. ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • RE: Consolidating instances of SQL server
    ... SQL Server is designed to use memory. ... The maximum amount of memory SQL Server can use varies depending on your ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • RE: The DBMS returned an unspecified error.
    ... | We are using Microsoft's JDBC driver for Java database access to SQL ... | Insufficient memory available. ... even though SQL Server 2000 is configured to use up to the ... the problem is most likely in the MemToLeave ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: multiple instances of sql - 2 Gb memory limitation?
    ... The 2GB Memory limitation is per instance and the SQL Server can be ... Configure memory for more than 2 GB in SQL Server ... Microsoft Windows 2000 Advanced Server or Microsoft Windows 2000 Datacenter ...
    (microsoft.public.sqlserver.server)