SQL SERVER – Copy Column Headers in Query Analyzers in Result Set

Copy Column Headers in Query Analyzers in Result Set.

In Query Analyzer go to Menu >> Tools >> Options >> Results
Select Default results Target: Results to Text
Results output format:(*): Tab Delimited
Print column headers(*): Checkbox ON(check)

Reference : Pinal Dave (http://blog.SQLAuthority.com)

18 thoughts on “SQL SERVER – Copy Column Headers in Query Analyzers in Result Set

  1. a: thanks, I can’t tell you how many times I looked for this, and I never noticed that I can change the format of the output.

    b: just a note if you have any numbers with leading zeros in the data (some zipcodes, etc): if you save the file with a csv extension excel will open it and drop the zeros, if you save it as .txt and then open it in excel you will get a text import wizard, the wizard will allow you to set that column as text so it comes in correctly.

    Like

  2. Pingback: SQL SERVER – Copy Column Headers from Resultset – SQL in Sixty Seconds #026 – Video « SQL Server Journey with SQL Authority

  3. Pingback: SQL SERVER – Weekly Series – Memory Lane – #027 | SQL Server Journey with SQL Authority

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s