SQLTeam.com | Weblogs | Forums

SSRS Subscription email sends incorrect attachment


SSRS Subscription email sends the attachment from different recipient.


post a screen shot of your subscription settings


I have a stored procedure that processes all the data into a single table, I then loop thru each recipient and place only that targeted recipient into a process table. This process table contains all of the data need for the report and the recipient's info such as name email address etc... This is the info that I use for the subscription info. The stored procedure then runs the subscription. I also placed a delay in the stored procedure to give time for the report and subscription to run. But I still have an intermittent issues with this occurrence.


so your query here shows the list of recipients and other metadata of the email. where is the attachment part, how are you doing that part?

how do you marry these together


That data is in the process table "dbo.Partner_Draw_Monthly_Report_Process_MST" that is used by the report for this subscription.


how is one report data differentiated from another for each recipient?


The table that is used for processing the report is truncated after each report subscription is send, and then loops to the next recipient and loads the data from that recipient into the process table again to be sent out again.


It appears that I found out what the issue might have been.

One of the reports took way longer to process then it should have (meaning 28 seconds, compared to an average of 50 milliseconds) causing the next two reports to grab the data from the report report that was taking long to process. All of these reports are around the same size and very small. So it looks like it may have taken long to process due to a network issue. I was able to see this processing time data in the ExecutionLogStorage table in the ReportServer database.

Thanks for your time.

Also, If you can quickly explain how you would send out multiple reports to multiple recipients (Meaning each recipient receives their own data). I thought I was doing it correctly, but their maybe another way.


Are all of the reports named the same? I suspect there might a design change opportunity here you might want to think of? In the past I have used SSIS to do that. make sure you touch base with your network admin, or mail server admin so that in case it flags your emails as SPAM (that happened to me)