Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating SQL Server table
Message
 
To
09/03/2005 10:54:10
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00994024
Message ID:
00994075
Views:
22
Jerry,
The only way to get that many records into MySQL is use use the LOAD DATA INFILE command. It was taking 4 hours to do a data covert and the time went to 2 Minites!!! when I used this. Make sure the vfp Text file is on the same drive as the MySQL database or MySQL will not allow the import. Be sure to use this syntax exactly as you see it.
* mVFPTxtFile is the text file that VFP creates.
* mSQLTxtFile is what MySQL imports.  Remeber that MySQL expects Forward 
* Slashes and not Back Slashes in the path.  They both point to the same file.

copy to (mVFPTxtFile) deli with "" with tab

* Run the command to import into MySQL
mCommand = "LOAD DATA INFILE '"+ mSQLTxtFile +"' INTO TABLE " ;
+ mDbfFile ;
+ [ FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' ;]
=SqlExec(mHandle, mCommand)
*
>I need to insert 400,000 records from a VFP8 table into a Sql Server table nightly.
>
>I have created an updatable remote view in my VFP DBC to this SQL Server table. I then update the Sql Server table as follows.
>
>***
>USE myRemoteView IN 0
>USE myvfptable IN 0
>SELECT myvfptable
>SCAN
>   SCATTER MEMVAR
>   INSERT INTO myRemoteView FROM MEMVAR
>ENDSCAN
>***
>
>
>All this works, but it takes a long time to complete. Is there a faster way to run this process? How can I speed this up>
>
>Thanks,
>
>Jerry
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform