Create Pivot , Exporting the result into flat file with Column Header

  • Dear All,

    I am trying to create pivot of some table.

    some how i managed to create pivot. Now i am exporting the resultant data into flat file. while doing so i am unable to retrieve column headers since while creating pivot column headers are dynamic.

    I am using BCP command to export the data into txt.

    1. Select * from Table : giving me only data not column

    2. SELECT [Column 1], [Column 2].... ---> I cant use this query since my column are dynamic and that depends on the data i have in my table.

    How to get dynamic column headers into flat file????

    Please help me with this.

    Thanks

    Regards,

    Deepika

  • Why not have a UNION of two selects?

    One that selects column names for the first row and another that selects actual data?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply