RAJARSHI GUHA
Jul 28, 2015 8:05:53 AM

Exporting SQL query results to CSV programmatically

Hi, I have a problem where I need to run 8 SQL queries in batch mode and would like to export the results of each query to a separate file. As far as I could tell from searhcing the site, I need to manually export each query resultset. Is there a way to programmatically export SQL queries to CSV (much like the MySQL syntax INTO OUTFILE)? I'm currently using the free trial version, but will be happy to update to the paid version if that functionality is available there.

BTW, this tool saved me many hours of agony fighting with Access. Much appreciated!



Synametrics support engineer
Jul 28, 2015 11:44:35 AM

Exporting SQL query results to CSV programmatically

Rajarshi,

There is no exact equivalent of INTO OUTFILE in WinSQL. You can certainly create an export template and then export the data that way.

We are working on the new release of WinSQL (version 10). Besides other features, the new version has a special comment that is parsed locally in WinSQL and will allow saving the grid contents automatically to a CSV file. For example you can write something like:

-- wn_SaveToCSV C:\Temp\customers.csv
SELECT * FROM Customer

Besides displaying the data in grid, the above comment will make WinSQL to save the contents to customers.csv file.

The next version of WinSQL is currently under beta testing. Send us an email to support@synametrics.com if you like to beta test it.



Rajarshi
Dec 3, 2015 9:21:06 PM

Exporting SQL query results to CSV programmatically

Hi,  does the current beta of v10 support this feature?



Synametrics support engineer
Dec 4, 2015 4:57:41 AM

Exporting SQL query results to CSV programmatically

Yes, it is there in the Beta. Visit http://web.synametrics.com/WinSQLBeta.htm for details.

Navigation

Social Media

Powered by 10MinutesWeb.com