Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

store the results of a query in a file

Status
Not open for further replies.

ASmee

IS-IT--Management
Jul 9, 2002
46
US
How do you do this via the Query analyzer.

I know that you can do this in Oracle SQLPlus with the spool command, I also know you can use ISQL/OSQL, but I want to know if it possible to pass the output of my query in query analyzer to a file locally on my HDD.
 
Two ways in Query Analyzer:

First: Go to TOOLS>OPTIONS and select the Results tab. You can make the change there.

Second: There is an icon called EXECUTE MODE (hover your mouse pointer over the icons to see the names). Click the down arrow next to the icon.

-SQLBill
 
Thanks, this is only applicable in MS SQL 200 though? I don't seem to find the same thing in my SQL 7.0 analyzer.
 
Sorry, you didn't state it was for SQL Server 7. I don't use version 7 so I don't know if it's the same or how you would do it in that version.

-SQLBill
 
You will need to let your query finish executing. then click in the results area and select file/save as filename.extension you want. you know you are in the right areas because it will try to make the defualt extention .rpt. if it trys to make it .sql you are in the query area still, not the results area.

This works in sql2k too, but its easier for results to file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top