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

Outputing to a text file within a sql script Expand / Collapse
Author
Message
Posted Thursday, November 14, 2013 12:50 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 2:22 PM
Points: 60, Visits: 128
Hello --

I have created a sql script that generates output when run within the SQL Studio application. I want to able to output to a text file, and I wanted to know if there is a command that be included within the script to so. Can someone provide insight into this?

Thanks.
Post #1514452
Posted Thursday, November 14, 2013 1:10 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, January 08, 2014 10:42 AM
Points: 13, Visits: 75
If you are executing the script manually yourself then right click on result set area, click on 'save result as' and save your file in any format; if you are executing the script through job then giving 'output file' location would do..
Post #1514461
Posted Thursday, November 14, 2013 1:45 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Saturday, April 12, 2014 11:40 AM
Points: 2,795, Visits: 8,297
You can use BCP to output from T-sql to a text file


Post #1514470
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse