Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mass Insert 1

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
I have written an application in delphi which performs a mass insert (1000+ lines). However, I am inserting each line into the table one-by-one, e.g.

INSERT INTO invoice_data VALUES (...)

Is there any way I can insert all 1000 in one go? Is this a better way to perform a mass insert?

Thanks.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Certainly!

You can use:
INSERT INTO invoice_data
VALUES
( ... ),
( ... ),
( ... )
where each ( ... ) represents one record. It will be faster because you only have one query-processing operation instead of 1000.
 
Thanks heaps, didn't know that was possible.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top