Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Sydney, Australia
    Posts
    10

    Red face Unanswered: Removing headers from sql output

    I'm writing a query which creates a script that I then want to be able to run, but can't get rid of the headers.

    eg. my query is similar to this:
    USE master
    go
    set nocount on
    go
    select 'restore database @dbname = N' + "'" + db_name() + "'" + ','
    go
    select '@filename' +convert(varchar(5),fileid)+ ' = N'+convert(varchar(50),filename)+',' from sysfiles
    go

    The output is similar this:
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------
    restore database @dbname = N'master',


    ---------------------------------------------------------------------
    @filename1 = Nd:\sysdata\SQL2000\MSSQL${instancename}\data\mast er.mdf,
    @filename2 = Nd:\sysdata\SQL2000\MSSQL${instancename}\data\mast log.ld,

    I want to get rid of all the '-------' and lines between the output.

    Can anyone help please?

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189

    Re: Removing headers from sql output

    Hello,

    which database do you use ? Looks like MSSQL ?

    Regards

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Sep 2002
    Location
    Sydney, Australia
    Posts
    10

    SQL2000

    I'm writing the script for SQL2000 -

Posting Permissions

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