OK. I figured out a way how to do this and in case anyone
else wants to do it...
Call osql using Operating System Command from the job step.
osql -Ssrever -Uuser -Ppassword -Q"DB.dbo.stored proc"
I'd still be interested in know how other people do it.
Still need to play around a bit with the file format.
Amelia.
>--Original Message--
>Using the SQLServer job scheduler, just wondering if it
is
>possible to call a stored proc in a job step using Type
>Transact-SQL and then save the results out to a text file?
>At the moment, I am using Operating System Command Type
to
>call a command file which calls a windows script file
>using javascript to call the stored proc using osql and
>then specifiying the file name for output here.
>This must be a common thing in Prod Support environments
>to schedule daily jobs to run taht produce result files
>saved somewhere. Is there a simpler way?
>Thanks for any help.
>.
>
Another way is to use the T-SQL job type step. When viewing
the job step properties, click the advanced tab. From there,
you can specify an output file for the results of the t-sql
command for the job step.
-Sue
On Tue, 29 Jun 2004 18:28:42 -0700,
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>OK. I figured out a way how to do this and in case anyone
>else wants to do it...
>Call osql using Operating System Command from the job step.
>osql -Ssrever -Uuser -Ppassword -Q"DB.dbo.stored proc"
>I'd still be interested in know how other people do it.
>Still need to play around a bit with the file format.
>Amelia.
>is
>to
|||Thanks Sue. I didn't know this method either.
:0)
Amelia
>--Original Message--
>Another way is to use the T-SQL job type step. When
viewing
>the job step properties, click the advanced tab. From
there,
>you can specify an output file for the results of the t-
sql[vbcol=seagreen]
>command for the job step.
>-Sue
>On Tue, 29 Jun 2004 18:28:42 -0700,
><anonymous@.discussions.microsoft.com> wrote:
anyone[vbcol=seagreen]
step.[vbcol=seagreen]
file?[vbcol=seagreen]
environments
>.
>
|||This is exactly what I was after. I feel so silly that I
did not see this before.
Thanks again.
Amelia
[vbcol=seagreen]
>--Original Message--
>Thanks Sue. I didn't know this method either.
>:0)
>Amelia
>viewing
>there,
>sql
>anyone
>step.
it[vbcol=seagreen]
Type[vbcol=seagreen]
>file?
Type[vbcol=seagreen]
and[vbcol=seagreen]
>environments
files
>.
>
|||You have plenty of company - a lot of people miss that this
functionality is available.
Glad it helped -
-Sue
On Sun, 4 Jul 2004 21:02:26 -0700, "Amelia"
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>This is exactly what I was after. I feel so silly that I
>did not see this before.
>Thanks again.
>Amelia
>it
>Type
>Type
>and
>files
Showing posts with label osql. Show all posts
Showing posts with label osql. Show all posts
Friday, March 30, 2012
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
>
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
>
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
Thankshi 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...
> 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[vbcol=seagreen]
>|||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
> 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[vbcol=seagreen]
>
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
Thankshi 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...
> 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[vbcol=seagreen]
>|||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
> 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[vbcol=seagreen]
>
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
Thankshi 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...
> 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
> >
> >
>|||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
> 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...
> > 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
> > >
> > >
> >
> >
>
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
Thankshi 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...
> 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
> >
> >
>|||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
> 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...
> > 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
> > >
> > >
> >
> >
>
Subscribe to:
Posts (Atom)