Link to home
Start Free TrialLog in
Avatar of VitaminD
VitaminDFlag for United States of America

asked on

Wrapping an email in a stored procedure

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'
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial