Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cshekar
Starting Member
49 Posts |
Posted - 2001-12-11 : 14:16:04
|
| wrote a Stored procedure where it is selecting all the rows from the table.I wanted save those results in to the file for exampleI wanted save the results as C:\SaveProcresults\ **.sql or txtis that posible or not is there any function with in Stored procedureuse as save results in file.Thanks |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2001-12-11 : 14:31:33
|
| You could use BCP, which is a command-line command. It could be executed from within a stored procedure by calling master..xp_cmdshell (if that procedure hasn't been blocked from use).-------------------It's a SQL thing... |
 |
|
|
SKIBUM
Starting Member
32 Posts |
Posted - 2001-12-11 : 14:46:58
|
| Use Query Analyzer.Before Executing your Stored Procedure, click in the Query Menu, then Results to File...(ctrl+shift+F).This will save your results to a txt file :)Good luck! |
 |
|
|
cshekar
Starting Member
49 Posts |
Posted - 2001-12-11 : 16:17:51
|
I am not asking from Query Analyzer I wanted to know within Stored proc is any way that I can mention save out file as because all my stored proc execute automatic in a package so all the out put I wanted save in a file.ThanksChandraquote: Use Query Analyzer.Before Executing your Stored Procedure, click in the Query Menu, then Results to File...(ctrl+shift+F).This will save your results to a txt file :)Good luck!
chandra shekar |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2001-12-11 : 16:20:40
|
| Mark's suggestion to use bcp is a perfect idea.Edited by - robvolk on 12/11/2001 16:20:58 |
 |
|
|
|
|
|