From: Doogie on
Hi,
I'd like to write sql code that takes the results of some queries and
dump them into excel. I'm told you can use bcp to do that...but I
also want to format the results - all without leaving sql. So for
example I'd like to make the column headers bold, etc. I'm told bcp
probably can't do that. Is there a way to do this all within Sql?
From: Russell on
I had to do this previously. From what I can remember, I had an excel file
that had the headings in it bolded etc. Part of the script would copy this
from a template folder and then the query would be run to put the results
into it.

Regards

Russell

"Doogie" wrote:

> Hi,
> I'd like to write sql code that takes the results of some queries and
> dump them into excel. I'm told you can use bcp to do that...but I
> also want to format the results - all without leaving sql. So for
> example I'd like to make the column headers bold, etc. I'm told bcp
> probably can't do that. Is there a way to do this all within Sql?
>
From: Mariano Gomez on
You will need to use OPENQUERY to accomplish this -- of course, if SSIS is
not an option.

Visit
http://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/
for a great deal of info on how to use it with Jet databases.

As for formatting, you are probably better off creating a macro in your
spreadsheet that does all this for you.

Best regards,
--
MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com


"Doogie" wrote:

> Hi,
> I'd like to write sql code that takes the results of some queries and
> dump them into excel. I'm told you can use bcp to do that...but I
> also want to format the results - all without leaving sql. So for
> example I'd like to make the column headers bold, etc. I'm told bcp
> probably can't do that. Is there a way to do this all within Sql?
>
From: Madhivanan on
On Jul 24, 7:29 pm, Doogie <dnlwh...(a)dtgnet.com> wrote:
> Hi,
> I'd like to write sql code that takes the results of some queries and
> dump them into excel.  I'm told you can use bcp to do that...but I
> also want to format the results - all without leaving sql.  So for
> example I'd like to make the column headers bold, etc.  I'm told bcp
> probably can't do that.  Is there a way to do this all within Sql?

Also refer
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926