Wednesday, March 21, 2012

export a query to Excel

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,
JoeNot sure how others do it, but I create a DTS package and then execute the D
TS
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|||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
>|||Hi
Check out http://www.sqldts.com/default.aspx?200
John
"jaylou" <jaylou@.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:
>

No comments:

Post a Comment