Solved

Wrapping an email in a stored procedure

Posted on 2012-03-21
1
203 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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