Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 683
  • Last Modified:

Query without column header text

I need to eliminate the column header and '_' text that is returned by default. I had thought there was something like the 'set nocount on' to control this but don't find it in BOL (SQL2K)
0
juststeve
Asked:
juststeve
  • 3
  • 3
1 Solution
 
CJ_SCommented:
I really have no idea what you mean with column header.

The set nocount returns a recordset when there is one, and supresses the messages in the Messages tab.
The set noexec on doesn't execute the query but compiles it.

What exactly do you want?
0
 
juststeveAuthor Commented:
Column  header =  that first row output by a query that identifies the given column. If in QA using 'text' or 'save to file' mode the column names are 'printed' in the first row and the second row is the underbar character repeated across the width of the column.

I'm trying to construct an HTML table by intermixing the HTML code with the query output. I have everything working but need to eliminate those column names and '_' from the beginning of the query.
0
 
LowfatspreadCommented:
in query analyzer

select Query
select current connection options
select Advanced
Unselect Print Headers

and for OSQL/ISQL
 use -h-1

to specify no headers...

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
CJ_SCommented:
That is pretty much built into the Query Analyzer. When you fire a query using ADO the returned resultset will contain only the data and a seperate object for the fieldnames. The query analyzer just reads those columnnames and adds them to the eventual output. I don't think you can get around that using a single query... the query analyzer is meant for database administration and not for automation purposes. if you really want to automate those results i think you should not read / ignore the first two lines.

Or am I misunderstanding your question?
0
 
CJ_SCommented:
Lowfatspread, I couldn't find that place. Disd find it here though: Tools -> options -> Results
0
 
LowfatspreadCommented:
CJ_S
you are missunderstanding the question i think...

and qa  (in its batch version) is perfectly ok for standard Data manipulation...

although DTS is probably the expected route these days..  
0
 
LowfatspreadCommented:
sorry yes i work mainly with sql server 7 ....

you've  presumably got sql 2K

;-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now