Wednesday, March 28, 2012

Hide Column Header in the Results

I have a stored procedure and I want to save the results in a file. I don't
want the column header to be in the file. I need to generate the file daily.
It has just one column. Example the results is showing:
Msg
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
I want the following results without the Header and extra line in the file.
How can I achive this. I have tried isql and isql/w but no success yet.
{1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
{2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
Use osql instead, with option -h -1.
Example:
C:\TEMP>osql -Spivotalr5 -E -Q"select top 5 orderid, orderdate from
northwind..o
rders" -h-1
AMB
"Fraz" wrote:

> I have a stored procedure and I want to save the results in a file. I don't
> want the column header to be in the file. I need to generate the file daily.
> It has just one column. Example the results is showing:
> Msg
> --
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
> I want the following results without the Header and extra line in the file.
> How can I achive this. I have tried isql and isql/w but no success yet.
> {1:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111XXX@.MYE@.-}
> {2:@.:20:040705@.:21B:XXXX@.:33A:040705XXX00000,@.:55D :111X@.MYE@.-}
>

No comments:

Post a Comment