-
Removing header from sql output
What sql command can I use to remove the headers from 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:sysdataSQL2000MSSQL${instancename}datamaster.md f,
@filename2 = Nd:sysdataSQL2000MSSQL${instancename}datamastlog.l d,
I want to get rid of all the '-------' and lines between the output.
Can anyone help please?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|