Home All Groups Group Topic Archive Search About

export a query to Excel

Author
23 Dec 2005 7:10 PM
jaylou
Hi all,
Is there a way to export the results of a query to an Excel file?

I need to create a report in a Stored procedure and I want it to email an
excel file to a group.  I know how to create the email and attach the file,
but I dont know how to Automatically create the file thru my Sproc.

TIA,
Joe

Author
23 Dec 2005 8:47 PM
myob@beatles.com
Not sure how others do it, but I create a DTS package and then execute the DTS
package from a SP using xp_cmdShell

exec master.dbo.xp_cmdshell "DTSRun /S gic042a /U xx /P xxxxx /N
Scorecard_Monthly_Imports"

Be interesting to see how others do it.

j
-- Posted with NewsLeecher v3.0 Beta 6
-- http://www.newsleecher.com/?usenet
Author
27 Dec 2005 1:02 PM
jaylou
Thank you.  That's a very good idea.  All I need to do is add a dateStamp to
my file name for history.

Thanks,
Joe

Show quote
"Johnny" wrote:

> Not sure how others do it, but I create a DTS package and then execute the DTS
> package from a SP using xp_cmdShell
>
> exec master.dbo.xp_cmdshell "DTSRun /S gic042a /U xx /P xxxxx /N
> Scorecard_Monthly_Imports"
>
> Be interesting to see how others do it.
>
> j
> -- Posted with NewsLeecher v3.0 Beta 6
> -- http://www.newsleecher.com/?usenet
>
Author
27 Dec 2005 2:40 PM
John Bell
Hi

Check out http://www.sqldts.com/default.aspx?200

John

Show quote
"jaylou" <jay***@discussions.microsoft.com> wrote in message
news:D269AA8E-2943-432A-9970-66E894BCB6D2@microsoft.com...
> Thank you.  That's a very good idea.  All I need to do is add a dateStamp
> to
> my file name for history.
>
> Thanks,
> Joe
>
> "Johnny" wrote:
>
>> Not sure how others do it, but I create a DTS package and then execute
>> the DTS
>> package from a SP using xp_cmdShell
>>
>> exec master.dbo.xp_cmdshell "DTSRun /S gic042a /U xx /P xxxxx /N
>> Scorecard_Monthly_Imports"
>>
>> Be interesting to see how others do it.
>>
>> j
>> -- Posted with NewsLeecher v3.0 Beta 6
>> -- http://www.newsleecher.com/?usenet
>>

AddThis Social Bookmark Button