Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Stored Procedure (or) SQL Script Output to Text File Expand / Collapse
Author
Message
Posted Monday, October 17, 2011 1:25 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 6:32 AM
Points: 883, Visits: 1,410
you could create a OS command job stem andcall sqlcmd from the OS with the header option set like so:

sqlcmd -h-1 -i "D:\scriptdir\script.sql" -o "D:\outputdir\outputtext.out"

fairly sure that'll give you what you're looking for.
Post #1191592
Posted Monday, October 17, 2011 1:27 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 6:32 AM
Points: 883, Visits: 1,410
NJ-DBA (10/17/2011)
you could create a OS command job stem andcall sqlcmd from the OS with the header option set like so:

sqlcmd -h-1 -i "D:\scriptdir\script.sql" -o "D:\outputdir\outputtext.out"

fairly sure that'll give you what you're looking for.


just noticed the age of this thread... saw the previous BT ? post... anyhow better late than never?
Post #1191594
Posted Thursday, August 1, 2013 4:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 4:16 AM
Points: 2, Visits: 0
www.javaquery.com/2013/08/how-to-create-log-file-fromfor-stored.html
Post #1479859
Posted Thursday, August 1, 2013 4:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 4:16 AM
Points: 2, Visits: 0
www.javaquery.com/2013/08/how-to-create-log-file-fromfor-stored.html
Post #1479860
Posted Tuesday, November 12, 2013 9:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 7, 2014 9:15 AM
Points: 6, Visits: 151
Hi,
The output file in the SQL Agent works for me too.

However, I want to run the stored proc from an SSIS package and write all the outputs (PRINT and SELECT command) into a text file. How do I do that?

Thanks,
Irina
Post #1513534
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse