ODBC Connection to Flat file
What is the best way to take a database and make it a flat file?
I am have an ODBC driver and need to pull the data out into a file file.
Excel, Acce开发者_开发百科ss? OpenOffice?
I'd suggest Excel as the fastest way to export data from any datasource that supports ODBC or OLEDB and write it out to a flat file.
The tools in Excel are helpful in shaping the query to the database.
Once you get it into Excel, you can then choose to Save As to .csv, .txt or transform it however you like.
If you want to set up relationships and to manipulate the data database-style, Access offers a range of import options, at least as many as Excel.
As an alternative, you could run a SQL command from the database to create the csv file. This has the advantage of allowing you to use complex SELECT statements. Here is a simple example using MySQL:
select emp_id, emp_name from emps
into outfile 'c:/test.txt';
精彩评论