You can do this way Ganesh.
with cte as (
Select distinct emailid, validationstatus from testtable)
Select emailid from cte
where validationstatus='Failed'
Do you know how many email id's you are expecting..? roughly..
Keep the above in a execute SQL task and throw the result in to an object variable type, put the result set to full result set.
And then iterate the object variable type through for each lookup task and put email task in the foreach so for every iteration new emailid is sent to email task as TOLine will be variable mapped to object variable type.
Let me know if you face any issues.
Note: In the foreach task , change the enumerator type to Foreach ADO Enumerator.
- please mark correct answers