Tuesday, March 20, 2012

save results in a proper format

Whenever i save results in query analyser or even when i run osql and use
the -o switch to output to a file, the results always appear in an
unreadable format.
Is there any way where i can view the entire row in one line as opposed to
multiple lines.. So if i have 10 rows as the output of a query , i would
like to see
10 straight lines that i can scroll from left to right in notepad along with
the column names obviously.. But everytime those 10 rows are on 100 lines
and its really unreadable...
Is there a better way to save this from QA and also other switches to be
used for osql ? Or maybe there is some options in notepad or wordpad to
make it appear better .. Please suggest..( Note that i do not have my word
wrap on ) .. But i guess you guys who saved results before know what im
talking about
Thanks
hi hassan
I dont know whats going wrong with, but i save my result in following way
using query analyzer
first i on "show result in grid" by pressing Ctrl+D
then execute the query
click on left, top corner of the grid and copy the contents
paste in notepad or excel sheet .
this work fine
Ansari
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:#4P2CqCgEHA.384@.TK2MSFTNGP10.phx.gbl...
> Whenever i save results in query analyser or even when i run osql and use
> the -o switch to output to a file, the results always appear in an
> unreadable format.
> Is there any way where i can view the entire row in one line as opposed to
> multiple lines.. So if i have 10 rows as the output of a query , i would
> like to see
> 10 straight lines that i can scroll from left to right in notepad along
with
> the column names obviously.. But everytime those 10 rows are on 100 lines
> and its really unreadable...
> Is there a better way to save this from QA and also other switches to be
> used for osql ? Or maybe there is some options in notepad or wordpad to
> make it appear better .. Please suggest..( Note that i do not have my word
> wrap on ) .. But i guess you guys who saved results before know what im
> talking about
> Thanks
>
|||Well Id like to just save it without do the cut and paste.. Also i have jobs
that use osql to output to text files that does not format right
"M.M Ansari" <mudasar_ansari@.hotmail.com> wrote in message
news:OFr4KUDgEHA.3548@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> hi hassan
> I dont know whats going wrong with, but i save my result in following way
> using query analyzer
> first i on "show result in grid" by pressing Ctrl+D
> then execute the query
> click on left, top corner of the grid and copy the contents
> paste in notepad or excel sheet .
> this work fine
> Ansari
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:#4P2CqCgEHA.384@.TK2MSFTNGP10.phx.gbl...
use[vbcol=seagreen]
to[vbcol=seagreen]
would[vbcol=seagreen]
> with
lines[vbcol=seagreen]
word
>
|||hi Hassan
Well, it was misunderstanding...You can use BCP utility to export your data.
here is the sample one
BCP "SELECT * FROM NORTHWIND.DBO.ORDERS" queryout
c:\orders.txt -c -r\n -t\t -Usa -Pansari -Smudasaransari\mma
BCP is a command line utitlity and you may see the BOL for detail of
swtiches I have used there. remmber that switches are case sensitive.
hope this will solve your problem.
Thanks
Ansari
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:ef748pIgEHA.596@.TK2MSFTNGP11.phx.gbl...
> Well Id like to just save it without do the cut and paste.. Also i have
jobs[vbcol=seagreen]
> that use osql to output to text files that does not format right
> "M.M Ansari" <mudasar_ansari@.hotmail.com> wrote in message
> news:OFr4KUDgEHA.3548@.TK2MSFTNGP09.phx.gbl...
way[vbcol=seagreen]
> use
opposed[vbcol=seagreen]
> to
> would
along[vbcol=seagreen]
> lines
be[vbcol=seagreen]
to[vbcol=seagreen]
> word
im
>

No comments:

Post a Comment