lowerkey
lowerkey

Reputation: 8335

Is it possible in TSQL to have the first row be the column name?

That would be extremely helpful when copying values from Sql Server Management Studio into Excel.

Is there such a template to pour my queries into?

Upvotes: 0

Views: 852

Answers (3)

Apurav
Apurav

Reputation: 198

Dint quite understand your question, but you can export the data Sql Server Management Studio to excel, Or select all rows right click copy and paste.

Upvotes: 0

Bort
Bort

Reputation: 7638

No, nothing exists to make the first row contain the column headers, however as Martin Smith points out in the comments, if all you want to do is copy the results to Excel (or anything else) with the column headers included, you can right-click and use 'Copy with Headers'

enter image description here

Upvotes: 3

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239744

No, there's no option to make the column names part of the result set.

This is not surprising, since each column can only contain values of a single data-type - and it's quite unusual to have result sets where every column is text. So even if it was an option, it would be of limited utility.

Upvotes: 2

Related Questions