File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9978,15 +9978,9 @@ CREATE PROCEDURE [dbo].[uspConsumeEnrollments](
99789978 -- get the insuree which are not included in "insureeToProcess"
99799979 DECLARE @insureeToDelete TABLE(CHFID NVARCHAR(12))
99809980 INSERT INTO @insureeToDelete(CHFID)
9981- SELECT CHFID
9982- FROM (
9983- SELECT CHFID FROM @insureeToProcess
9984- UNION ALL
9985- SELECT CHFID FROM @tblInsuree TI
9986- ) tbl
9987- GROUP BY CHFID
9988- HAVING count(*) = 1
9989- ORDER BY CHFID;
9981+ SELECT IP.CHFID FROM @insureeToProcess IP
9982+ LEFT JOIN @tblInsuree I ON I.CHFID=IP.CHFID
9983+ WHERE I.CHFID is NULL
99909984
99919985 -- iterate through insuree to delete - process them to remove from existing family
99929986 -- use SP uspAPIDeleteMemberFamily and 'delete' InsureePolicy also like in webapp
Original file line number Diff line number Diff line change @@ -675,15 +675,9 @@ CREATE PROCEDURE [dbo].[uspConsumeEnrollments](
675675 -- get the insuree which are not included in "insureeToProcess"
676676 DECLARE @insureeToDelete TABLE (CHFID NVARCHAR (12 ))
677677 INSERT INTO @insureeToDelete(CHFID)
678- SELECT CHFID
679- FROM (
680- SELECT CHFID FROM @insureeToProcess
681- UNION ALL
682- SELECT CHFID FROM @tblInsuree TI
683- ) tbl
684- GROUP BY CHFID
685- HAVING count (* ) = 1
686- ORDER BY CHFID;
678+ SELECT IP .CHFID FROM @insureeToProcess IP
679+ LEFT JOIN @tblInsuree I ON I .CHFID = IP .CHFID
680+ WHERE I .CHFID is NULL
687681
688682 -- iterate through insuree to delete - process them to remove from existing family
689683 -- use SP uspAPIDeleteMemberFamily and 'delete' InsureePolicy also like in webapp
You can’t perform that action at this time.
0 commit comments