How to Convert DBF File to MS SQL Server

Working with legacy databases often means dealing with DBF files. These dBASE or FoxPro tables are still widely used in accounting, ERP, and other industry-specific applications. However, when companies migrate to modern systems, they usually prefer storing their data in Microsoft SQL Server for reliability, scalability, and integration with enterprise tools.

One of the most convenient ways to convert DBF files into SQL Server scripts is through DBF Viewer 2000. This lightweight but powerful tool allows both manual export and automated batch conversion, eliminating the need for complex ODBC drivers or risky third-party scripts. If you want to know how to convert DBF file to MS SQL Server, this guide explains the process step by step.

Why Convert DBF to MS SQL Server?

  • Data centralization: SQL Server provides a secure, enterprise-grade environment for storing and managing large datasets.
  • Integration: Modern business applications, BI platforms, and reporting tools integrate natively with SQL Server.
  • Performance: Queries on large tables run faster and more reliably in SQL Server than in flat DBF files.
  • Long-term support: Unlike DBF, which is tied to legacy applications, SQL Server is actively developed and supported by Microsoft.

How to Convert DBF File to MS SQL Server via GUI

Step 1. Open the DBF file.

Start DBF Viewer 2000 and open the .dbf file you want to export. The table contents will appear in the main window.

Step 2. Choose Export.

Go to the top menu and select "File | Save As/Export". Select SQL Server format. In the export dialog, you’ll see several database formats. Pick SQL Server (MS SQL) as the target.

Step 3. Save the output script.

Provide a destination file name, for example: customers.sql

Export DBF to MS SQL Server Screenshot

At this point you have successfully learned how to convert DBF to MS SQL using the graphical interface.


DOWNLOAD
for FREE

How to Convert DBF to MS SQL Server via Command Line

For automation, DBF Viewer 2000 also supports a command-line interface. This is useful for batch jobs, scheduled tasks, or processing dozens of DBF files at once.

"c:\Program Files (x86)\DBF Viewer 2000\dbview.exe" database.dbf /EXPORT:script.sql /MSSQL [/CREATEONLY | /FILTER | /WFILTER | /REVERSE | /COLUMNS | /FROMRECORD | /SORTBY:field ]

Simple Export to MS SQL Server format

"c:\Program Files (x86)\DBF Viewer 2000\dbview.exe" sample.dbf /EXPORT:script.sql /MSSQL

Create Database Table without records (Only Structure)

"c:\Program Files (x86)\DBF Viewer 2000\dbview.exe" sample.dbf /EXPORT:mydatabase.sql /MSSQL /CREATEONLY

Export with Columns Selection

"c:\Program Files (x86)\DBF Viewer 2000\dbview.exe" mybase.dbf /EXPORT:myscript.sql /MSSQL /COLUMNS:ZIP,NAME,PHONE

Export with Columns Names

"c:\Program Files\DBF Viewer 2000\dbview.exe" mydatabase.dbf /EXPORT:myscript.sql /MSSQL /INSERTWITHCOLUMNS

FAQ

Q: How can I convert DBF file to MS SQL Server easily?

A: The simplest way is to use DBF Viewer 2000, which lets you export in just a few clicks.

Q: Can I export multiple DBF files to SQL Server at once with DBF Viewer 2000?

A: Yes. Using the command-line mode, you can create a batch script to process multiple DBF files automatically. This is useful for large migrations or recurring tasks.

Q: Does DBF Viewer 2000 preserve indexes and relationships when exporting to SQL Server?

A: No. The tool exports the table structure and data, but DBF indexes and relationships need to be recreated manually in SQL Server after the import.

Q: What SQL Server versions are supported for DBF export?

A: The generated SQL scripts are compatible with most versions of Microsoft SQL Server.

Q: What should I do if character encoding looks incorrect after export?

A: Check the original DBF file’s encoding (ANSI, OEM, or Unicode) before export. In some cases, you may need to convert text fields or adjust collation settings in SQL Server to display characters properly.

Conclusion

If you are searching for how to convert DBF file to MS SQL Server, DBF Viewer 2000 provides a reliable solution. It works both via GUI and command line, making the conversion process simple even for large datasets.

Do you need other options for MS SQL Server format generation?

Please, contact us by E-mail: support@dbf2002.com or by On-line form.


DOWNLOAD
for FREE

See also: DBF to XLS (Excel), DBF to CSV, Filtering recordsCommand line options