November 18, 2010 at 11:07 am
In there a way to make a sqlect return the column headers in the acual result set? We're use bcp to send files and it's a pain in the but to ensure the column headers are in the result set at the top? I was hoping in sql server 2005 or 2008 this would have been addressed. has it?
November 18, 2010 at 12:55 pm
use a stored procedure instead of a select and have the stored procedure return a result set that includes the column names.
The probability of survival is inversely proportional to the angle of arrival.
November 18, 2010 at 1:49 pm
yep. I've resoved the issue several different ways. This isnt a new issue. Is there a way to submit these sorts of simple issue to possably be address in future sql server releases. The work around is a pain in the butt. Especially if it must be ordered in a certain way due to the data type differences.
November 18, 2010 at 2:05 pm
Yeah, well the solution I finally adopted was to write a little .NET program that generates csv files. Its a command line driven utility (so you can use it in batch files easily) that takes any query along with various command line switches to alter the format of the output data. One of the switches specifies whether the first row contains column names, another to specify the delimiter character, etc.
I use this utility all the time it is much handier than BCP.
The probability of survival is inversely proportional to the angle of arrival.
November 18, 2010 at 2:06 pm
November 18, 2010 at 2:19 pm
very cool. I will be doing the same when i have downtime. i love writting c# executables.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply