Re: faster way to write tables?




I'm building a large lookup table by using an ADOCommand, repetetively
setting the CommandText (and invoking Execute) in a loop for each row. The
CommandText string looks something like:

SELECT INTO out_table (col1, col2, col3) VALUES (x1, x2, x3)

It works, but it groans a bit when there are ~50,000 records; I wouldn't
want to use this method for one million records.

Is there something I can do to speed up output, like buffering the command
strings to SQL Server?

INSERT INTO out_table (col1, col2, col3) VALUES (:value1, :value2, :value3);

Prepare it, set the parameters to the required values, execute it.



--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


.