Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Importing FoxPro .dbf table into SQL Server with VFPOleDB driver Errors

Posted on 2010-09-23
3
Medium Priority
?
1,345 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:RVL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 43

Expert Comment

by:pcelba
ID: 33746917
DBF data access from SQL Server was always magic...

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.

0
 
LVL 14

Expert Comment

by:tusharkanvinde
ID: 33747246
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
0
 
LVL 30

Accepted Solution

by:
Olaf Doschke earned 1000 total points
ID: 33747304
Most probably empty dates, which SQL Server cannot cope with. You either need to set empty dates to NULL or some ultimo date, eg 1/1/1900. Also SQL Server below 2008 does not know the date only field type.

Bye, Olaf.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question