BCP issues

Hi Team,

I want to use BCP to export data from SQL to excel file and also I would need column headers in it.
Imagine there are 200 columns in my query. I want those column headers to appear in the output file along with the data.

exec master..xp_cmdshell'bcp "select zLEGACYLIFNR,zSOURCE,LAND1,NAME1 from dswPTP90.dbo.ttLFA1" queryout C:\queryoutput.xls -o "C:\querycommanddetails.txt" -T -c -C RAW'

And also, I would like to insert data from the 4th row in the output file.
Is it possible using BCP? If yes, can you please provide me the BCP code for it.

Can you please revert asap?

Thanks,
Sai Vadapalli
[email protected]
+91-8801968988
Sign In or Register to comment.