0

I have 327 .DBF files that i need to import in one table in a database in Mircosoft SQL server. These files all have the exact same structures, and are in the same location. Each file contains between 10,000 and 120,000 records.

I have been told that the easiest way to do this is to automate a conversion of all files to .txt then create a batch to merge all .txt files then import using the wizard.

Is there a way i can write a SP or other to just import the DBF files directly?

If so would appreciate some help.

Thanks

1
  • WHAT concrete database are you talking about? SQL is just a query language - used by many database systems, and they all have different approaches on how to import foreign data. So please update your tags with the appropriate database system (and version) you're using - be it MySQL, Postgres, SQL Server, Oracle, db2 or whatever else you might be using. .... Commented Jan 22, 2014 at 6:10

1 Answer 1

1

You can use DBF Commander Pro for your task.

Open a DBF file, click File -> Export to DBMS. At the window appears Build the connection string and select the target table of the database to export data to. At the bottom of the window you'll see command line for the current export process: load DBF to database

If you click on Export button then current DBF file will be exported to the database. But since you need to export 327 files, it's better to use a command line (BAT file) for this. So, you can create such BAT file, where every of DBF files will be exported with the command line you've got in a loop. E.g.:

dbfcommander.exe -edb "D:\Data\*some_filename*.dbf" destination_table "Provider=SQLOLEDB.1;User ID=user1;Initial Catalog=test_db;Data Source=test_server"

More info on export process you can find here. DBF Commander Pro using is described here. The app has 20 days fully-featured trial period, so you can perform your task absolutely for free.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a tone Oleg, works perfectly. Didn't even take that long.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.