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.