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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent

Status
Not open for further replies.

kenworld

Technical User
Joined
Aug 4, 2001
Messages
3
Location
US
Need help saving results of a sql script results to my hard drive, Example

select * from bir_table
go


Search results are saved to:
c:\bir.txt

Please help
Kenworld
 

I assume you want to do this automatically.

1) Use DTS
2) Use BCP
3) Use OSQL with the -o option to output to a file

Or you just want to run the query in Query Analyzer and then click on save.

It would be helpful if you provided more information about your process in order to provide a better answer. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
I'm trying to save results of request to my hard drive.

example:

select * from birtable
go

I want the results of this statement saved to c:\bir.txt

someone mention the exec cmp command.

I hope this helps.

kenworld
 
You didn't give much more detail. Do you want to know how save the output of a query to a text file from a stored procedure? Is that the question? If it is, then I assume what someone mentioned is Execute xp_cmdshell, an exetended stored procedure. See the SQL FAQ at the following link for info about outputting query results to a text file from a stored procedure using xp_cmdshell.

Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top