June 19, 2012 at 9:07 pm
How do you get query results with no column headers using a SET command?
June 20, 2012 at 12:23 am
I don't know. But this gives you a result set with no column headers:
SELECT 123, 456
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
June 20, 2012 at 12:44 am
June 20, 2012 at 2:17 am
I don't think it can be done using a SET command. Showing or hiding column headers is something that happens on the client side, not at the server side.
You can use the sqlcmd utility to query the database and suppress headers:
sqlcmd -h-1
For more information see sqlcmd Utility.
Hope this helps
Gianluca
-- Gianluca Sartori
June 20, 2012 at 5:29 am
Are you talking about when you copy/paste from SSMS?
in Management Studio, it's an option you can turn on and off:
Tools>>Options>>Query Results>>SQL Server>>
Results To Grid has a checkbox for "Include column headers when copying or saving results"
Results to Text has a similar checkbox for "Include column results in the result set"
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply