Question:
SQL statement to write query results to file?
julesagogo
2006-11-08 07:46:39 UTC
I'm using EMS SQL Manager LITE 2005 for SQL Server and I thought there was a statement to write the results of the query to a file on my hard drive. This free tool doesn't have this functionality (the full one does have "save query results as abc.txt") and my query result has 80k rows - it's taking forever for the machine to copy/paste them.

Thanks in advance!
Five answers:
Manzana verde
2006-11-08 16:19:50 UTC
no 'normal' query like that, unless your database system support it (eg. Interbase). check your database help for 'external file' .

if your database didn't support it, build your tools.

or you can try to export it to CSV files (text files), not from sql query, but from your database/dataset component.
2016-10-31 11:52:01 UTC
Sql Manager Lite
Doug k
2006-11-08 08:33:39 UTC
If you have SQL Server 2000 and Enterprise Manager, right click the table, all tasks, export. Follow the steps on the screen.



If you are using the express version of SQL Server 2005, there is no easy way to do this without writing code. This is done on purpose. MS wants you to buy the pro version.
life goes on...
2006-11-08 08:19:43 UTC
well thats a big headache ,what i think you can do is do a query like



select * from table



and all the records be loaded in the sql window.Then click on the table in the right of the screen (where the column names are there) and click on copy with header to excel.now copy it to excel sheet.open the excel sheet and save it as a tab delimited file
2016-05-22 01:55:02 UTC
Access does not support CASE statement. Try to use switch or IIF embeded functions.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...