Hi Guys,
I need your help. I have a query below. i wanna use this query in SSIS package which would run every week. All this query doing is, truncate table PlanFinder.InvalidAwps and load 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 dont know how package would send email if any invalid record found in InvalidAwps table.
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 <= 0 OR A.Price IS NULL)
AND p.Ndc IS NOT NULL
Thanks. Appreciate any help