title: SSIS Help : How to Send Email if invalid Records Found from a query
body: <p>I want to use the below query in an SSIS package which would run every week. All this query is doing is truncating table PlanFinder.InvalidAwps and loading it with new Invalid records. Now, how do I use this query in SSIS package to send email if any invalid record found in invalidAwps table? I can use execute sql task but don'st know how the package would send email if any invalid record found in InvalidAwps table.</p>
  
  <pre><code>truncate table [PlanFinder].[InvalidAwps] 
  go 
  
  insert into [PlanFinder].[InvalidAwps] 
      (Ndc, AwpUnitCost) 
      SELECT DISTINCT P.Ndc Ndc, A.Price AwpUnitCost 
      FROM 
          PlanFinder.PlanFinder.HpmsFormulary P 
          LEFT JOIN (SELECT Ndc, Price FROM MHSQL01D.Drug.FdbPricing.vNdcPrices  
                     WHERE PriceTypeCode = '01' AND CurrentFlag = 1) A 
      ON P.Ndc = A.Ndc  
      WHERE (A.Ndc IS NULL OR A.Price &lt;= 0 OR A.Price IS NULL) 
      AND p.Ndc IS NOT NULL  
  </code></pre>