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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SP output into a file

Author  Topic 

dbaman
Starting Member

46 Posts

Posted - 2007-07-13 : 09:34:24
I have SQLServer7. I am running some stored procedure. I would like to know how I can redirect the output of the Stored_procedure run into a file?



R

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-13 : 09:38:31
using bcp?

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

dbaman
Starting Member

46 Posts

Posted - 2007-07-13 : 09:42:08
At this time I am running my Stored procedures from the query analyzer. I am looking for a way within QueryAnalyzer or outside the get the output in a text file

R
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-13 : 09:50:09
choose Results to file option from the toolbar

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

dbaman
Starting Member

46 Posts

Posted - 2007-07-13 : 10:32:28
Thanks ==Spirit1==

Is there a way I can run my stored procedure from outside Query Analyzer ( I mean from command line / a batch file) and redirect output to a file.

R
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-13 : 10:56:43
with bcp.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Haywood
Posting Yak Master

221 Posts

Posted - 2007-07-13 : 15:39:47
quote:
Originally posted by spirit1

with bcp.




There is also the option to drop to a cmdshell and execute sqlcmd with the -Q & -o options....
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-07-13 : 18:15:00
Sql7 doesn't have sqlcmd, use isql or osql instead.
Go to Top of Page

p.shaw3@ukonline.co.uk
Posting Yak Master

103 Posts

Posted - 2007-07-14 : 11:11:46
>>Is there a way I can run my stored procedure from outside Query Analyzer ( I mean from command line / a batch file) and redirect output to a file.

DTS would be an option from SQL Server 7
Go to Top of Page
   

- Advertisement -