2

How can I tell SQL Server 2008 Management Studio to turn off printing of header dashes when displaying text results in a query window?

Examples of header dashes being produced are:

selectId, count(*) ContentCount from Table group by Id order by count(*) desc produces:

Id                   ContentCount
-------------------- ------------------
622                  5
623                  1

select 'Person Info' produces:

------------
Person Info

Those dashes are not conducive to all situations so I expect there is way to turn them off.

John K
  • 28,441
  • 31
  • 139
  • 229
  • Nit pick - this is not a "SQL Server" feature. It is a "SQL Server Management Studio" feature. – Oded Nov 19 '10 at 17:08
  • Looks like this is still the right place for this question http://meta.stackexchange.com/questions/70544/ and FAQ says `software tools commonly used by programmers` http://stackoverflow.com/faq I changed the question tag from SQL Server to Management Studio. – John K Nov 19 '10 at 18:15

4 Answers4

3

Goto Tools, Options, Query Results. You can change the output to Grid if you want there. I don't see a way to turn off just the dashes in the Results to text options. Check that - change to Comma Delimited and the dashes don't show up.

Decker97
  • 1,643
  • 10
  • 11
0

Solution : Under Options/Query Results/SQL Server/Results to Text there is a checkbox to untick entitled 'Include column headers in the result set'.

However, I wanted to do this programmatically, as I perform a query as part of an email report that looks a mess with the headers, but haven't found out a way yet (which IS a SQL Server issue).

Dawn
  • 193
  • 2
  • 9
0

this is an incorrect SQL statement.

set head off set und off

ecmthr
  • 1
  • 1
-8

for a SQL query, type the following above the Select statement:

to remove the headers, type: set head off

to remove the underline, type: set und off