[ACCEPTED]-How to import a DBF file in SQL Server-dbf

Accepted answer
Score: 19

Use a linked server or use openrowset, example

SELECT * into SomeTable
FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;
SourceDB=\\SomeServer\SomePath\;
SourceType=DBF',
'SELECT * FROM SomeDBF')

0

Score: 6

I was able to use the answer from jnovation 5 but since there was something wrong with 4 my fields, I simply selected specific fields 3 instead of all, like:

select * into CERTDATA
from  openrowset('VFPOLEDB','C:\SomePath\CERTDATA.DBF';'';
    '','SELECT ACTUAL, CERTID,  FROM CERTDATA')

Very exciting to finally 2 have a workable answer thanks to everyone 1 here!

Score: 2

What finally worked for us was to use the 6 FoxPro OLEDB Driver and use the following syntax. In our case 5 we are using SQL 2008.

select * from 
    openrowset('VFPOLEDB','\\VM-GIS\E\Projects\mymap.dbf';'';
    '','SELECT * FROM mymap')

Substitute the \\VM-GIS... with 4 the location of your DBF file, either UNC 3 or drive path. Also, substitute mymap after 2 the FROM with the name of the DBF file without 1 the .dbf extension.

Score: 2

http://elphsoft.com/dbfcommander.html can export from DBF to SQL Server and vice 1 versa

Score: 0

This tools allows you to import to and from 1 SQL Server.

More Related questions