Importing FoxPro DBF File Data In SQL Server Database

Sometimes, we get requirement like client requires his/her FoxPro data in new application. As technology is getting improved and upgraded, the old Star Fox Pro is not that upgraded. First of all, I would like to salute FoxPro for maintaining the software business, when people were not even aware of the software.

Ok, going ahead with solution. Follow the below steps.

  1. Open your Management Studio and go to "Import and Export Wizard". Select Microsoft Office 12.0 Access Database Engine OLE DB Provider. After selection, you will find the "Properties"button. Click on it.

    SQL Server

  2. Select ‘Data Source’ and click on ‘Edit Value’ button.

  3. SQL Server

  4. Enter the path of folder where you have your .dbf files. Do not enter path with .dbf file name, you have to enter path till folder name and click OK.

  5. SQL Server

  6. Click on "Extended Properties". and click on "Edit Value" button. In Property value textbox, enter the version of ‘dBASE’. In my case, it's ‘IV’. If you don’t know about your version, then enter any version name. If it’s not matching to your files, then it would throw error message until successful. Click OK and then Next button.

  7. SQL Server

  8. Select your SQL Server in destination and database whichever you want - select or create new. After doing necessary things, click on Next button.

  9. SQL Server

  10. Select action that you want to perform. In my case, I am selecting ‘copy data from one or more tables or views’. Click on Next.

  11. SQL Server

  12. Select all tables or select tables which you want, and click on Next.

  13. SQL Server

  14. Few tables may not be able to convert. See image below.

  15. SQL Server

  16. So, I do like to suggest you to select tables which are only required. You can test which .dbf files are usable by opening them in Excel. Click Next or Finish.

  17. SQL Server

  18. Click on Next.

  19. SQL Server

  20. Check the status and click on Finish.

  21. SQL Server

    SQL Server

In this way, you can use .dbf data in SQL Server database. If your .dbf file contains a million rows, you may face issues with using that file. In that case, copy this data in parts in Excel sheet and fetch that Excel data in SQL Server.

Happy Coding!