November 18, 2014 at 11:20 pm
I have written an SSIS package that includes an Execute SQL Task within a ForEach Loop to send an Email if a long running query is detected.
The issue is that the same Email is being sent three times.
Has anyone else seen this behavior?
November 19, 2014 at 1:02 am
Is the Send Email Task inside the loop?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 19, 2014 at 1:31 am
Yes
November 19, 2014 at 1:40 am
I'm not sure how your package is configured, but it would make sense to me that when a task is inside a loop, it can be executed multiple times.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 19, 2014 at 5:47 pm
Yes I think that is the issue but am struggling to see why, as the Email task only seems to be executed once for each pass through the loop
November 19, 2014 at 10:31 pm
If I run the same EXEC msdb.dbo.sp_send_dbmail routine through SSMS only one Email is sent.
If I run this through a SQL task in SSIS I get three emails. However, I checked the DBMail logs and it only says one Email was sent.
If I run this through a SQL task in SSIS using Send Mail Task I only get one email.
Seems like this is specific to SSIS / sp_send_dbmail?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply