Hi
You could look at DTS (the export data option in Enterprise manager (right
click the table/all tasks/expor data) will guide you though a wizard to do
this, and you can save the DTS package at the end, or you could use a UNION
statement and QUERYOUT in your BCP statement that will output the column
names (as text) unioned with the data (converted to text). You will need a
method to order the data so that the column names appear first this can be
done by creating an extra column in the query, unfortunately this column
would also be exported, but to get this you can go through a holding table.
To run a dts package from a stored procedure see
http://www.sqldts.com/default.aspx?210.
John
"noor" <NO********@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi
I have been working since 2 days to device a method to export sql table
into csv format. I have tried using bcp with format option to keep the
column names but I'm unable to transfer the file with column names. and
also I'm having problems on columns having decimal data.
Can any one suggest me how to automate data transfer(by using SP) and
retaining column names.
Thanks
Noor