Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 underlines in SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-02 : 10:47:53
ho writes "When you run a SQL statement you might get something like this:

IssueID IssuedName
-------- ------------
32498N ABC
43588C CBXT
81102F MRQE
50017A FDO

Question: how do I eliminate the -------- under the field names ? What statement should be used to suppress SQL from returning the --------- on the 2nd row, so that the data start on 2nd row, instead of 3rd row ?"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-02 : 10:58:46
If you get this in Query Analyser, then
Set Results in Grid instead of Results in Text

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

KLang23
Posting Yak Master

115 Posts

Posted - 2005-08-02 : 12:52:50
HI,

If you want the output in "Text" format (like you were using) ie: for printing purposes, you can instruct QA to supress column headers.

You can do this from: Tools->Options->Results-> uncheck "Print Column Headers" checkbox.

If you are using ISQL, OSQL, etc., there are command-line options to accomplish the same thing. See BOL for the details.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-02 : 13:10:07
Its a bit six-of-one-half-a-dozen-of-the-other isn't it?

I used Grid mode in Query Analyser to then cut&paste the data to Excel. But I don't get any column headings - so I paste those across separately (from the first line of a "Results in Text" results window)

If I output as "Results in Text" the I have to do a fixed-width
Data : Text to Columns
conversion, which is a bit of a pain.

Kristen
Go to Top of Page
   

- Advertisement -