May 3, 2009 at 8:46 pm
I wish to use 'Results to File' option when executing a stored procedure and for the resultant dataset not to have embedded space characters. I have tried to find any execute option that allows me to suppress the column heading text and the '---------....' underline, but can't.
Is this possible, and will it suppress redundant space characters as well?
May 4, 2009 at 12:14 am
Hello,
In SSMS, you can use the following option to get rid of the headers:-
Tools, Options, Query Results, Results to Text, Include Column Headers in the Result Set
If you want a single space between each data item, you can try changing the Output Format on the same options page to “Space Delimited”.
Regards,
John Marsh
www.sql.lu
SQL Server Luxembourg User Group
May 4, 2009 at 12:18 am
In addition to the advice above, if you plan to do this on a regular basis, you should familiarize yourself with bcp (bulk copy program). It is a command line executable that comes with SQL Server. This will make it easier to automate this type of process.
May 4, 2009 at 6:11 am
Thanks heaps for the advice John.
The column headers were gone, but still had all the embedded blanks. I had included a | character to be used as a delimiter in my script so I removed that and then set the Output Format/Custom Delimiter to |.
Works like a treat.
Also, thanks Robert for the BCP advice. I'll do some further investigation.
Peter
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply