• The only way I have managed to achieve this with BCP is:

    Create a view

    The view should contain

    SELECT 'col1name' as col1name, 'col2name' as col2name etc

    UNION ALL -- all is important to avoid a sort

    SELECT -- all your columns from whatever table

    Then use BCP export the view.

    This does rely on the fact that the results of the union will have the first row first - which strictly speaking they may not be, but with it constructed as above I have never seen it incorrect.

    Add a function round each column to quote qualify if the column contains a quote, comma, NL etc and you have a very fast and really easy way of exporting to csv.

    Each column will need to be char or varchar - or cast to the correct type as well otherwise the union will complain about data types.

    Hope that helps

    Mike