How to import a DBF file in SQL Server

▼魔方 西西 提交于 2019-12-17 06:42:03

问题


How can you import a foxpro DBF file in SQL Server?


回答1:


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')



回答2:


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

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

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




回答3:


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




回答4:


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

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

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




回答5:


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

  • http://www.download3000.com/download_17933.html


来源:https://stackoverflow.com/questions/52822/how-to-import-a-dbf-file-in-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!