• er.deepikagoyal (10/4/2013)


    Thanks David for the reply.

    I am not using reporting services.

    Basically i am creating pivot of my data using TSQL and trying to dump the data into flat file using BCP.

    so here i am not able to fetch column headers

    Regards,

    Deepika

    No but sun_kuang is.

    If you are using dynamic sql to pivot data to a table then you have to use dynamic sql to SELECT it to get column names or use 'SELECT *' (which is deemed not to be good practice)

    Using complicated tsql with BCP can be troublesome as if I remember correctly BCP tries a FORMAT only attempt to get column details (not sure if this is the case) but I have encountered errors because BCP could not determine the output.

    Are you able to post the query and test data?

    Far away is close at hand in the images of elsewhere.
    Anon.