Showing posts with label analyser. Show all posts
Showing posts with label analyser. Show all posts

Thursday, March 8, 2012

Copying data from Query Analyser.

When copying data from QA, is it possible to copy the headers with the data?
I tried Select All then Copy but got just the data.
Regards
Thief_did you hear "Thief_" <thief_@.hotmail.com> say in
news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:

> When copying data from QA, is it possible to copy the headers with the
> data? I tried Select All then Copy but got just the data.
> Regards
> Thief_
>
if we're talking about column headers with the data, if you are querying
using grid view that's the best you can get. If you switch to text view
or send the results to a file (CSV or text) you will get the column
headings.
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||Hi ,

>From QA u will not be able to get the header name but if u tranfer ur
data to text file or excel file or access file u can get the table name
as well as the table structure.
HTH
from
Doller
Neil MacMurchy wrote:
> did you hear "Thief_" <thief_@.hotmail.com> say in
> news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:
>
> if we're talking about column headers with the data, if you are querying
> using grid view that's the best you can get. If you switch to text view
> or send the results to a file (CSV or text) you will get the column
> headings.
> --
> Neil MacMurchy
> http://spaces.msn.com/members/neilmacmurchy
> http://spaces.msn.com/members/mctblogs|||doller wrote:
> Hi ,
>
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
>
> Neil MacMurchy wrote:
>
If you use SQL Server Management Studio (Which is the "query analyzer"
that comes with SQL 2005), you can actually choose to include Column
Headers when you copy data from QA.
Regards
STeen|||did you hear "doller" <sufianarif@.gmail.com> say in
news:1127707753.325611.236790@.g43g2000cwa.googlegroups.com:

> Hi ,
>
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
I think we need to clear up the term 'header'. Are we speaking of column
headings? if we are choose "results in text" from the query menu in QA.
this will allow the full columns to be selected for editing (copy/paste)or
a report saved to a file. You can also choose the "results to file" option
to save the output to a csv file. you made need to modify the options for
your results to get them in the format you would like, but these can be
chosen from tools --> option --> results (for more details check "Managing
SQL Query Analyzer Windows" from books online).
the other type of header might be in reference to a backup. perhaps this
was in reference to extend properties of a database (the
fn_listextendedproperties), but my guess is that this is what I have
mentioned above.
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
#HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:

> If you use SQL Server Management Studio (Which is the "query analyzer"
> that comes with SQL 2005), you can actually choose to include Column
> Headers when you copy data from QA.
>
you can do that in 2000 as well. just don't do a "select *" ;)
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||Neil MacMurchy wrote:
> did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
> #HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:
>
> you can do that in 2000 as well. just don't do a "select *" ;)
>
Where can you specify that in Query Analyzer?
Regards
Steen|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in
news:urWES4zwFHA.904@.tk2msftngp13.phx.gbl:

> Where can you specify that in Query Analyzer?
select col1, col2, col3...
(it was a joke buddy...)
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs

Copying data from Query Analyser.

When copying data from QA, is it possible to copy the headers with the data?
I tried Select All then Copy but got just the data.
Regards
Thief_did you hear "Thief_" <thief_@.hotmail.com> say in
news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:
> When copying data from QA, is it possible to copy the headers with the
> data? I tried Select All then Copy but got just the data.
> Regards
> Thief_
>
if we're talking about column headers with the data, if you are querying
using grid view that's the best you can get. If you switch to text view
or send the results to a file (CSV or text) you will get the column
headings.
--
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||Hi ,
>From QA u will not be able to get the header name but if u tranfer ur
data to text file or excel file or access file u can get the table name
as well as the table structure.
HTH
from
Doller
Neil MacMurchy wrote:
> did you hear "Thief_" <thief_@.hotmail.com> say in
> news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:
> > When copying data from QA, is it possible to copy the headers with the
> > data? I tried Select All then Copy but got just the data.
> >
> > Regards
> >
> > Thief_
> >
> >
> if we're talking about column headers with the data, if you are querying
> using grid view that's the best you can get. If you switch to text view
> or send the results to a file (CSV or text) you will get the column
> headings.
> --
> Neil MacMurchy
> http://spaces.msn.com/members/neilmacmurchy
> http://spaces.msn.com/members/mctblogs|||doller wrote:
> Hi ,
>>From QA u will not be able to get the header name but if u tranfer ur
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
>
> Neil MacMurchy wrote:
>> did you hear "Thief_" <thief_@.hotmail.com> say in
>> news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:
>> When copying data from QA, is it possible to copy the headers with the
>> data? I tried Select All then Copy but got just the data.
>> Regards
>> Thief_
>>
>> if we're talking about column headers with the data, if you are querying
>> using grid view that's the best you can get. If you switch to text view
>> or send the results to a file (CSV or text) you will get the column
>> headings.
>> --
>> Neil MacMurchy
>> http://spaces.msn.com/members/neilmacmurchy
>> http://spaces.msn.com/members/mctblogs
>
If you use SQL Server Management Studio (Which is the "query analyzer"
that comes with SQL 2005), you can actually choose to include Column
Headers when you copy data from QA.
Regards
STeen|||did you hear "doller" <sufianarif@.gmail.com> say in
news:1127707753.325611.236790@.g43g2000cwa.googlegroups.com:
> Hi ,
>>From QA u will not be able to get the header name but if u tranfer ur
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
I think we need to clear up the term 'header'. Are we speaking of column
headings? if we are choose "results in text" from the query menu in QA.
this will allow the full columns to be selected for editing (copy/paste)or
a report saved to a file. You can also choose the "results to file" option
to save the output to a csv file. you made need to modify the options for
your results to get them in the format you would like, but these can be
chosen from tools --> option --> results (for more details check "Managing
SQL Query Analyzer Windows" from books online).
the other type of header might be in reference to a backup. perhaps this
was in reference to extend properties of a database (the
fn_listextendedproperties), but my guess is that this is what I have
mentioned above.
--
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
#HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:
> If you use SQL Server Management Studio (Which is the "query analyzer"
> that comes with SQL 2005), you can actually choose to include Column
> Headers when you copy data from QA.
>
you can do that in 2000 as well. just don't do a "select *" ;)
--
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs|||Neil MacMurchy wrote:
> did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
> #HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:
>> If you use SQL Server Management Studio (Which is the "query analyzer"
>> that comes with SQL 2005), you can actually choose to include Column
>> Headers when you copy data from QA.
> you can do that in 2000 as well. just don't do a "select *" ;)
>
Where can you specify that in Query Analyzer?
Regards
Steen|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in
news:urWES4zwFHA.904@.tk2msftngp13.phx.gbl:
> Where can you specify that in Query Analyzer?
select col1, col2, col3...
(it was a joke buddy...)
--
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs

Copying data from Query Analyser.

When copying data from QA, is it possible to copy the headers with the data?
I tried Select All then Copy but got just the data.
Regards
Thief_
did you hear "Thief_" <thief_@.hotmail.com> say in
news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:

> When copying data from QA, is it possible to copy the headers with the
> data? I tried Select All then Copy but got just the data.
> Regards
> Thief_
>
if we're talking about column headers with the data, if you are querying
using grid view that's the best you can get. If you switch to text view
or send the results to a file (CSV or text) you will get the column
headings.
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs
|||Hi ,

>From QA u will not be able to get the header name but if u tranfer ur
data to text file or excel file or access file u can get the table name
as well as the table structure.
HTH
from
Doller
Neil MacMurchy wrote:
> did you hear "Thief_" <thief_@.hotmail.com> say in
> news:ODKOU6jwFHA.2656@.TK2MSFTNGP09.phx.gbl:
>
> if we're talking about column headers with the data, if you are querying
> using grid view that's the best you can get. If you switch to text view
> or send the results to a file (CSV or text) you will get the column
> headings.
> --
> Neil MacMurchy
> http://spaces.msn.com/members/neilmacmurchy
> http://spaces.msn.com/members/mctblogs
|||doller wrote:
> Hi ,
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
>
> Neil MacMurchy wrote:
>
If you use SQL Server Management Studio (Which is the "query analyzer"
that comes with SQL 2005), you can actually choose to include Column
Headers when you copy data from QA.
Regards
STeen
|||did you hear "doller" <sufianarif@.gmail.com> say in
news:1127707753.325611.236790@.g43g2000cwa.googlegr oups.com:

> Hi ,
> data to text file or excel file or access file u can get the table name
> as well as the table structure.
> HTH
> from
> Doller
I think we need to clear up the term 'header'. Are we speaking of column
headings? if we are choose "results in text" from the query menu in QA.
this will allow the full columns to be selected for editing (copy/paste)or
a report saved to a file. You can also choose the "results to file" option
to save the output to a csv file. you made need to modify the options for
your results to get them in the format you would like, but these can be
chosen from tools --> option --> results (for more details check "Managing
SQL Query Analyzer Windows" from books online).
the other type of header might be in reference to a backup. perhaps this
was in reference to extend properties of a database (the
fn_listextendedproperties), but my guess is that this is what I have
mentioned above.
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs
|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
#HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:

> If you use SQL Server Management Studio (Which is the "query analyzer"
> that comes with SQL 2005), you can actually choose to include Column
> Headers when you copy data from QA.
>
you can do that in 2000 as well. just don't do a "select *" ;)
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs
|||Neil MacMurchy wrote:
> did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in news:
> #HoIwUnwFHA.3740@.TK2MSFTNGP14.phx.gbl:
>
> you can do that in 2000 as well. just don't do a "select *" ;)
>
Where can you specify that in Query Analyzer?
Regards
Steen
|||did you hear "Steen Persson (DK)" <spe@.REMOVEdatea.dk> say in
news:urWES4zwFHA.904@.tk2msftngp13.phx.gbl:

> Where can you specify that in Query Analyzer?
select col1, col2, col3...
(it was a joke buddy...)
Neil MacMurchy
http://spaces.msn.com/members/neilmacmurchy
http://spaces.msn.com/members/mctblogs

Saturday, February 25, 2012

copy/paste grid from QA - no field names!

for debug purposes i tried to copy paste some Query Analyser output into Excel... the data pastes fine, but i can't get the field-names to copy/paste.

is there a trick?

izyNot by itself...

YOu could save it as text...you get the column names that way...

Or you can Go

SELECT 'Col1', 'Col2', 'Ect'
UNION ALL
SELECT Col1, Col2, Ect
FROM your Table|||text! stupidly simple really.
thanks for the help,

izy|||Try results to Text & Tab delimited.
Under Tools --> Options --> Results.

It works OK for me.

Tim S

Friday, February 24, 2012

copy to Excel from output grid

When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..Hassan,
Unfortunately, you have to create an Excel-understood string
yourself. Here's an example of how you would do it with the
OrderDate column in Northwind's Orders table:
select
convert(varchar(30),OrderDate, 101)
+ space(1)
+ convert(varchar(30),OrderDate, 8)
from Northwind..Orders
This is for the US local month/day/year. If you need day/month/year
instead, use format 103 instead of 101. It's worth testing this a bit,
since quite a few factors can influence how dates are interpreted.
Steve Kass
Drew University
Hassan wrote:

>When i save the query analyser output to Excel, it always messes up the
>display for datetime columns ? Why is that ? and how can i copy and paste
>without do all the conversions,etc. ? Right now to show the actual datetime
>in excel, i have to format the cells to text and then paste again..
>
>
>|||Don't copy/paste. Instead, from the menu options, choose the output to be
Text, Comma Delimited instead of Grid, Column Aligned. Then save the output
as csv or just copy and paste this into Excel, which can handle this format
better than the fixed-width, Column Aligned format.
Sincerely,
Anthony Thomas
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e67sHppIFHA.2744@.tk2msftngp13.phx.gbl...
When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..

copy to Excel from output grid

When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..Hassan,
Unfortunately, you have to create an Excel-understood string
yourself. Here's an example of how you would do it with the
OrderDate column in Northwind's Orders table:
select
convert(varchar(30),OrderDate, 101)
+ space(1)
+ convert(varchar(30),OrderDate, 8)
from Northwind..Orders
This is for the US local month/day/year. If you need day/month/year
instead, use format 103 instead of 101. It's worth testing this a bit,
since quite a few factors can influence how dates are interpreted.
Steve Kass
Drew University
Hassan wrote:
>When i save the query analyser output to Excel, it always messes up the
>display for datetime columns ? Why is that ? and how can i copy and paste
>without do all the conversions,etc. ? Right now to show the actual datetime
>in excel, i have to format the cells to text and then paste again..
>
>
>|||Don't copy/paste. Instead, from the menu options, choose the output to be
Text, Comma Delimited instead of Grid, Column Aligned. Then save the output
as csv or just copy and paste this into Excel, which can handle this format
better than the fixed-width, Column Aligned format.
Sincerely,
Anthony Thomas
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e67sHppIFHA.2744@.tk2msftngp13.phx.gbl...
When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..

copy to Excel from output grid

When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..
Hassan,
Unfortunately, you have to create an Excel-understood string
yourself. Here's an example of how you would do it with the
OrderDate column in Northwind's Orders table:
select
convert(varchar(30),OrderDate, 101)
+ space(1)
+ convert(varchar(30),OrderDate, 8)
from Northwind..Orders
This is for the US local month/day/year. If you need day/month/year
instead, use format 103 instead of 101. It's worth testing this a bit,
since quite a few factors can influence how dates are interpreted.
Steve Kass
Drew University
Hassan wrote:

>When i save the query analyser output to Excel, it always messes up the
>display for datetime columns ? Why is that ? and how can i copy and paste
>without do all the conversions,etc. ? Right now to show the actual datetime
>in excel, i have to format the cells to text and then paste again..
>
>
>
|||Don't copy/paste. Instead, from the menu options, choose the output to be
Text, Comma Delimited instead of Grid, Column Aligned. Then save the output
as csv or just copy and paste this into Excel, which can handle this format
better than the fixed-width, Column Aligned format.
Sincerely,
Anthony Thomas

"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e67sHppIFHA.2744@.tk2msftngp13.phx.gbl...
When i save the query analyser output to Excel, it always messes up the
display for datetime columns ? Why is that ? and how can i copy and paste
without do all the conversions,etc. ? Right now to show the actual datetime
in excel, i have to format the cells to text and then paste again..