Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copy complete dbf to sql

72 views
Skip to first unread message

Dirk (Belgium)

unread,
May 4, 2012, 4:45:23 AM5/4/12
to
Hi all,

On a daily base, I have to copy all records from dbf to sql.
This is done in a task which runs during the night, but it takes
already 62 minutes (too long).

On this moment, I use the standard VO SQL classes.
First I do a prepare statement INSERT INTO <table> (field1,field2,...)
VALUES (?,?,...)

After this, for each record of the dbf file, I do the
SQLStatement{}:Execute() method with an array of the values.

So, this process takes to long.

My question:

Does someone know how to speed up this process ????

Thanx for any advice,

Dirk (Belgium)

--


Karl Faller

unread,
May 4, 2012, 6:35:59 AM5/4/12
to
Dirk,
i would try to do this the other way round, use the SQL DB to import
the DBF...

Karl

Er!k \/!$$Er

unread,
May 4, 2012, 7:42:49 AM5/4/12
to
Hi Dirk,

Write the values to CSV and do a BULK INSERT on the Sql database.
or have a look here:
http://stackoverflow.com/questions/883917/import-dbf-files-into-sql-server

hth

Erik



"Dirk (Belgium)" schreef in bericht news:jo04v3$kuo$1...@dont-email.me...

Dirk (Belgium)

unread,
May 4, 2012, 11:17:23 AM5/4/12
to
Hi Erik,

Your suggestion with BULK INSERT is the first way I gonna try...
Thanks for this good suggestion.

Dirk
0 new messages