Remove the lines '—-' from the query output | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Remove the lines ‘—-‘ from the query output

On TSQL Command of; set nocount on
select @@version Getting the output as; —————————————————————————————————————————————————————————————————————————————————————-
Microsoft SQL Server 2000 – 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
How to remove the lines "——-" from the output? ——————
S SIVAPRASAD
#2970;#3007; #2970;#3007;#2997;#2986;#3007;#2992;#2970;#3006;#2980;#3021;
Are you doing this in Query Analyzer? If you are showing results in text, there will be the —– at the top. If you set it to results in grid, it will not show that since the —- is not really part of the @@version output. John
In QA Text Output, Tools.. Options.. Results tab unselect "Print Column Headers", this removes those lines.
What do you want to do with that result? —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
In QA, press Ctrl+D to switch to results in Grid Madhivanan Failing to plan is Planning to fail
Uncheck the "Include the Column headers in Result" in Query Option
The silly response would be: select the line of hyphens, and delete them. But I probably shouldn’t be posting silly responses.
Here is the sample query and output. Please note the query I am passing would vary. Tell me how can I get the output without the lines. Note: Please avoid silly responses like CTRL+D, Uncheck Column Headers.
Also I do not want to do the Find/Replace sort of processing result set again. D:Documents and SettingsSRVRt>osql -E -Sw2SRVRt01 -Q"set nocount on select @@version" ——————————————————————————-
——————————————————————————-
——————————————————————————–
————————————————————– Microsoft SQL Server 2000 – 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows
NT 5.1 (Build 2600: Service Pack 2) ——————
S SIVAPRASAD
#2970;#3007; #2970;#3007;#2997;#2986;#3007;#2992;#2970;#3006;#2980;#3021;
You didn’t mention you were using the OSQL tool, so how were we to know that you’re not working in Query Analyzer?[<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]
A quite important fact that you’re using OSQL, that you’ve missed to mention in your original post, don’t you think? [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]<br />The answers can only be as good as the question is. So please avoid notes like this:<br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><br /> Note: Please avoid silly responses like CTRL+D, Uncheck Column Headers.<br />Also I do not want to do the Find/Replace sort of processing result set again.<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />Before getting into another misunderstanding, can you please tell us, what you want to do with the result and why *exactly* you want this without the column headers?<br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a>
Note: Please avoid silly posts that don’t give all the required information in the first place.
If you are using it in a OS Batch command, try using the PRINT instead. DECLARE
@Data VARCHAR(8000) SELECT @Data = @@VERSION
PRINT LEFT(@Data, DATALENGTH(@Data))
— instead of SELECT May the Almighty God bless us all!
www.empoweredinformation.com
Are you storing the result for any reports to management? Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided �AS IS� with no rights for the sake of knowledge sharing.
If you are using OSQL then how will be your result set.
I think that will be in some file. then you need to do play around that file to get all information right.
Ganesan B.
Well defined problem is half way solved.
]]>