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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP output to CSV file

Status
Not open for further replies.

dcuffee

Programmer
Joined
Jun 11, 2010
Messages
1
Location
US
I am using the below code to create a .CSV file using a BCP commmand.

What I need to know is how do I make the first row in the CSV file the column names? IS there some option on the BCP command to do this

or will it be more difficult?

declare @sql varchar(8000)

SET @sql = 'bcp Appliance.AppAppliances.AudioVideo out c:\av.csv -c -t, -T -S' + @@servername

exec master..xp_cmdshell @sql

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top