Solved

Wrapping an email in a stored procedure

Posted on 2012-03-21
1
201 Views
Last Modified: 2012-03-22
I am calling my stored procedure but I need to take the results of my Sproc
and send the results as a csv file in an email

How exactly would I do this?

 I am calling this job inside my stored procedure

Exec msdb.dbo.sp_send_dbmail
                  @profile_name = 'PSDB01@xxxx.com',
                  @recipients = @EmailRecipients,
                  @subject = 'Account_Report',
                  @body = 'File(s) attached'
0
Comment
Question by:VitaminD
1 Comment
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 37750950
why not sending the email from within the stored procedure ?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now