Search code examples
sql-server-2008database-migrationdbfvisual-foxpro

DBF file table structure to create table in SQL server


I am trying to migrate DBF files to MS SQL Server 2008. While importing files from SQL Server Import And Export Wizard. I am unable to import the files. I have created the connection. But when I try to Edit Mappings/ Preview the table It shows error "External table is not in expected format"

Anyhelp would be appreciated.


Solution

  • If you can't get the wizard to work, you'd have to write your own code, using linked servers or OPENROWSET. If you are new to SQL Server, linked servers and OPENROWSET are about the last thing you want to have to figure out.

    Once upon a time long long ago, I wrote drivers in Foxpro that read data from and wrote data to SQL Server tables. This would have been SQL Server 7.0, and I was probably using OLE DB. If SQL can't talk to Foxpro (which wouldn't surprise me), you may need to get Foxpro to talk to SQL.

    Failing that, dumping from Foxpro to some form of text delimited file and then importing them will work, though it'd take more effort.