If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Removing headers from sql output

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-25-02, 02:43
davistr davistr is offline
Registered User
 
Join Date: Sep 2002
Location: Sydney, Australia
Posts: 10
Red face 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?
Reply With Quote
  #2 (permalink)  
Old 09-25-02, 04:34
alligatorsql.com alligatorsql.com is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 09-25-02, 19:13
davistr davistr is offline
Registered User
 
Join Date: Sep 2002
Location: Sydney, Australia
Posts: 10
SQL2000

I'm writing the script for SQL2000 -
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On