I need to export some select/ stored procedures results to excel files. I tried
Exec master..xp_cmdshell 'bcp TransactCIB.dbo.test out c:\Temp.xls -c -q -S"(local)" -U"sa" -P""'
to get the results to a excel file. But I can not get the headers. Is there anyway to include the header in excel file? please show details, thanks.
I use sqlserver 2000.