Results 1 to 4 of 4

Thread: Supressing Column headers

  1. #1
    Join Date
    Jul 2004
    Location
    SLC, UT
    Posts
    15

    Supressing Column headers

    hello,

    Just curious if we can supress column headers in SQL Server..

    example:

    create table Empmaster
    (
    empid int identity(1,1),
    empname varchar(10),
    empsalary numeric
    )

    insert Empmaster(empname,empsalary)values('Imran',5000)
    insert Empmaster(empname,empsalary)values('Raja',5000)
    insert Empmaster(empname,empsalary)values('Ram',8000)

    Sql:
    Select empname, empsalary from Empmaster

    would have a result set like (this is not an exact result from analyser)

    empname empsalary
    ----------- ------------
    Imran 5000
    Raja 5000
    Ram 8000

    But I was wondering if I could somehow make it display

    Imran 5000
    Raja 5000
    Ram 8000

    I actually implementation of this is something vast, but I have illustrated a very simple example to explain what I want to achieve. Might seem a very simple 1 line solution, but I haven't been able to find it. .If ther is any documentation that might help please reply and point me to that..

    thank you

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Yes, you can turn off column header in query analyzer. Go to tools -> options -> results tab, uncheck 'print column headers'.

  3. #3
    Join Date
    Jul 2004
    Location
    SLC, UT
    Posts
    15
    but I wanna do this from command line with osql to write the result to a file ...

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,922
    If you are running it as a script from command prompt, OSQL has a parameter -h to suppress heading. It is -h -1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •