Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming output to a .CSV file

Status
Not open for further replies.

hne

Programmer
Oct 16, 2003
38
0
0
US
Hello,
I would like to know how can I program my MsSQL to send my output to a .CSV file? Thanks.
 
you can use stored proc with bcp command/format file to create csv file

code

Exec master..xp_cmdshell ''bcp "SELECT * FROM ##WrkData_LBW_Exp_2" queryout ' + CSV_FILE_Location + ' -f loanbase_format_2.fmt

Thanks
 
You can use BCP, BulkInsert, or DTS to export data from MS SQL to a CSV file.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top