RVL
asked on
Importing FoxPro .dbf table into SQL Server with VFPOleDB driver Errors
I am having difficulty importing a FoxPro v7 .dbf file into SQL Server 2000 using the vfpoledb driver. The foxpro table is approaching 2 GB in size and I am looking for a solution where I don't have to split these tables by migrating this data to SQL Server where there isn't this limit. When trying to import through the DTS Import/Export Wizard and select "Microsoft OLE DB Provider for Visual FoxPro" for the datasource and select the free table I get the following errors a few seconds after it has begun the import process:
Error at Destination for Row number 1. Errors encountered so far in this task: 1. Insert error, column 62('date', DBTYPE_DBTIMESTAMP), status 6: Data overflow. Invalid character value for cast specification.
Seems to be getting stuck on the Memofields (with the ODBC driver) and DateTime fields with the OleDB. Can anyone provide direction on this? Any suggestion for a good 3rd party tool?
Error at Destination for Row number 1. Errors encountered so far in this task: 1. Insert error, column 62('date', DBTYPE_DBTIMESTAMP), status 6: Data overflow. Invalid character value for cast specification.
Seems to be getting stuck on the Memofields (with the ODBC driver) and DateTime fields with the OleDB. Can anyone provide direction on this? Any suggestion for a good 3rd party tool?
dbf files can have blank dates. you will have to replace all blank dates with null before importing.
You can try http://vfpx.codeplex.com/releases/view/10224
You can try http://vfpx.codeplex.com/releases/view/10224
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you cannot import data on SQL then you may export them from VFP. It is just a simple loop:
Open connection to SQL Server
Open DBF file
Create table on SQL Server
Loop through DBF file
Insert each record from DBF into SQL Server table
Close DBF
Close connection
You can, of course, investigate what values are incorrect for import via OLE DB. Try to import a few records only and then you may look at the data values or try to import more records etc. BTW, what is the SQL data type for DateTime field from VFP? You should use nullable DateTime.