Home All Groups Group Topic Archive Search About

Query Analyzer-Result to Text

Author
26 Jan 2007 2:41 PM
HLong
Hi, I am trying to print the query result directly from the query analyzer. I
am having two probles.  One - I can't find a way of changing the <untitled>
title on the result, so I have to put it by hand.  Is there a way of changing
the title?  Two - Some of the fields on the tables were created too wide,
more than the should have been, so the result column are too wide for the
data.  Is there a way of narrowing the result columns?  I would really
appreciate any help

Author
26 Jan 2007 4:14 PM
Andrew J. Kelly
I don't know how to change the title. I never print directly. I typically
use the grid and copy and paste to Excel. You can issue a CAST() in the
select on the wide columns to make them as small as you want.

--
Andrew J. Kelly SQL MVP

Show quote
"HLong" <HL***@discussions.microsoft.com> wrote in message
news:338E2DC7-46DD-4E06-A0CB-BB89B8C5C343@microsoft.com...
> Hi, I am trying to print the query result directly from the query
> analyzer. I
> am having two probles.  One - I can't find a way of changing the
> <untitled>
> title on the result, so I have to put it by hand.  Is there a way of
> changing
> the title?  Two - Some of the fields on the tables were created too wide,
> more than the should have been, so the result column are too wide for the
> data.  Is there a way of narrowing the result columns?  I would really
> appreciate any help
Author
31 Jan 2007 7:17 PM
HLong
Thank you. CAST() works fine for some columns but not for all, specially
calculated columns.  I tried (cast(columnA .....)*cast(columnB.....)) but it
didn't work.

Show quote
"Andrew J. Kelly" wrote:

> I don't know how to change the title. I never print directly. I typically
> use the grid and copy and paste to Excel. You can issue a CAST() in the
> select on the wide columns to make them as small as you want.
>
> --
> Andrew J. Kelly SQL MVP
>
> "HLong" <HL***@discussions.microsoft.com> wrote in message
> news:338E2DC7-46DD-4E06-A0CB-BB89B8C5C343@microsoft.com...
> > Hi, I am trying to print the query result directly from the query
> > analyzer. I
> > am having two probles.  One - I can't find a way of changing the
> > <untitled>
> > title on the result, so I have to put it by hand.  Is there a way of
> > changing
> > the title?  Two - Some of the fields on the tables were created too wide,
> > more than the should have been, so the result column are too wide for the
> > data.  Is there a way of narrowing the result columns?  I would really
> > appreciate any help
>
>
>
Author
1 Feb 2007 5:40 AM
Andrew J. Kelly
You should do the calculation first and then cast it. I thought you were
talking about character columns anyway.

--
Andrew J. Kelly SQL MVP

Show quote
"HLong" <HL***@discussions.microsoft.com> wrote in message
news:061E730D-C6D1-4F64-BC0B-2F105F7E3203@microsoft.com...
> Thank you. CAST() works fine for some columns but not for all, specially
> calculated columns.  I tried (cast(columnA .....)*cast(columnB.....)) but
> it
> didn't work.
>
> "Andrew J. Kelly" wrote:
>
>> I don't know how to change the title. I never print directly. I typically
>> use the grid and copy and paste to Excel. You can issue a CAST() in the
>> select on the wide columns to make them as small as you want.
>>
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "HLong" <HL***@discussions.microsoft.com> wrote in message
>> news:338E2DC7-46DD-4E06-A0CB-BB89B8C5C343@microsoft.com...
>> > Hi, I am trying to print the query result directly from the query
>> > analyzer. I
>> > am having two probles.  One - I can't find a way of changing the
>> > <untitled>
>> > title on the result, so I have to put it by hand.  Is there a way of
>> > changing
>> > the title?  Two - Some of the fields on the tables were created too
>> > wide,
>> > more than the should have been, so the result column are too wide for
>> > the
>> > data.  Is there a way of narrowing the result columns?  I would really
>> > appreciate any help
>>
>>
>>

AddThis Social Bookmark Button