Get columns from query analyser HELP !

  • Hi, I'm trying to run some data from query analyser and then extract this onfo in excel.

    As there a lot of columns in analyser I want to copy the column names into excel.

    is there any way to get the column name ?

    Regards

    Ritesh

  • Please don't cross post. It fragments replies and wastes people's time

    Continue here

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • In Management Studio, Go to Tools->Options->Query Results->Results To Text and in Output format change it to CSV.

    While executing the query, select Results to File (option in the toolbar) in query window. When you try to execute SSMS will ask you to save the results in a CSV file. You can open CSV files in excel.

    The other way would be to run a SSIS package to run your query and output data into excel.

    Hope this helps!

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

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