large csv import

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 3
Joined: Mon 02 Jul 2007 16:28

large csv import

Post by olsonware » Mon 02 Jul 2007 17:50

I am wondering if there is an example of importing a comma delimited file using the TMSLoader component (or other means). I haven't seen one and the demo only uses random values... doesn't really apply.

I have the need to import many rows of data (300k to 2.7 million rows) and I am hoping to improve performance using Delphi...

Thank you in advance,

Doug Olson

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 03 Jul 2007 09:41

No, there is no such example, but you can modify the existing Loader demo so that it parses an input file in OnPutData or GetColumnData event handler and posts values to the server.

Another solution is to load your CSV file using a DataSet descendant component, and transfer all records to database using the LoadFromDataSet method of TMSLoader.

The first approach should work faster.

Post Reply