SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stored Procedure (or) SQL Script Output to Text File


Stored Procedure (or) SQL Script Output to Text File

Author
Message
NJ-DBA
NJ-DBA
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3486 Visits: 1556
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.
NJ-DBA
NJ-DBA
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3486 Visits: 1556
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?
vkijust4u
vkijust4u
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 0
www.javaquery.com/2013/08/how-to-create-log-file-fromfor-stored.html
vkijust4u
vkijust4u
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 0
www.javaquery.com/2013/08/how-to-create-log-file-fromfor-stored.html
irina hossain
irina hossain
SSC-Enthusiastic
SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)SSC-Enthusiastic (126 reputation)

Group: General Forum Members
Points: 126 Visits: 163
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
RickNPHX
RickNPHX
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 Visits: 20
WayneS,
I have same problem. I've entered path and filename in the advanced tab for output file, but I only get about 16 lines of printed output statements. My developers need to see a lot more output than this, because they are verifying each process with SQL Printed output statements. Is there some reason it's not printing all of the output, and a fix for that? thanks, Richard Peninger rpeninger@azdes.gov.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search