Monday, March 19, 2012

Copying grid results with column headers

Is there any way to copy grid query results with the column headers? When I
copy and paste the results into Excel now I have to manually type the
headers so I know what I'm looking at.David,
if you are referring to Query Analyser, you can change the output format to
"Results to File...". On Tools, Options, Results, you can select to take the
column headers and select csv, column aligned etc formats. If this is a
regular process, you might like to do this in a DTS package.
HTH,
Paul Ibison|||Do you know if there's a way to enable copying the column headers from the
grid results though? I may want to actually see the results visually before
deciding I want to copy it, making the Resuts to File a less appealing
option. If it's a long running query, running to grid first then again to
file would double the time. I'll paste the results into Excel.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OaanEGlSEHA.3768@.TK2MSFTNGP11.phx.gbl...
> David,
> if you are referring to Query Analyser, you can change the output format
to
> "Results to File...". On Tools, Options, Results, you can select to take
the
> column headers and select csv, column aligned etc formats. If this is a
> regular process, you might like to do this in a DTS package.
> HTH,
> Paul Ibison
>|||David,
not directly as far as I know. 'Results to text' will give you visual output
with column headers, but it usually won'y format correctly in Excel.
Regards,
Paul Ibison|||Why not go into EXCEL and IMPORT DATA - use a NEW SQL CONNECTION and get to
your DATABASE.
Then from in there you can load a table, execute a query, etc.
It will load right into the EXCEL grids - headings and all - and if you like
what you see, save as XLS or CSV or TDF or whatever you want - EXCEL does t
hem all.

No comments:

Post a Comment