Friday, February 24, 2012

Dynamic table query for DBF files

Hi. I am using DBF files as sources for some tables in SQL Server. The problem is that the table names in the DBF files are not all the same (e.g. frame061, frame949). I want to know the names of the tables inside the DBF files. Is there a way to query the table names, something like "select table_name from information_schema.tables" in SQL Server? By the way, those DBF files came from FoxPro. Thanks!
Edit: I completely misread your question...|||

If you are working with individual DBF files (as opposed to the later DBC database containers, with which I'm not familiar), then it's my understanding that file = table, so you would need a list of *.DBF files in the file system folder that constitutes the database.

You could use the Foreach Loop container with the Foreach File enumerator to do something with each matching file in the folder. Or you could use the simple methods of System.IO within a Script task to get your list.

-Doug

|||I think the question has been misinterpreted. sorry. A single DBF contains 4 tables inside the single file. That means 1 file = 4 tables. What I would like to do is to get the names of the 4 tables INSIDE the single DBF file, using SSIS. Is there a possible solution to this? Thanks in advance!

No comments:

Post a Comment