select mfr_id, mfr_name from tblManufacturers with (nolock) where exists ( select * from tbl_TPM_Claims with (nolock) where ownerId = mfr_id and ownerType = 'MFR' ) and mfr_id = and 'MFR' =

#htmleditformat( mfr_name )#

select operatorId from tbl_OPR_ClientOperators with (nolock) where fsltablecode ='MFR' and fsl_choId = 612 and ownerId =

No Entegra Record

select claimId from tbl_TPM_Claims with (nolock) where partnerId = and partnerType = 'OPR' and ownerId = and ownerType = 'MFR'

No Entegra Claims

select pod.operatorName, pod.operatorAffiliateNbr, max( c.claimPeriodEnd ) activityDate from tbl_TPM_ProofOFdelivery pod with (nolock) inner join tbl_TPM_Claims c with (nolock) on c.claimId= pod.claimId and c.ownerId = pod.ownerId and c.ownerType = pod.ownerType left outer join tbl_OPR_CLientOperators opr with(nolock) on opr.operatorId = pod.operatorId and opr.ownerId = pod.ownerId and opr.fsltablecode = pod.ownerType left outer join tbl_CHO_Operators cho with (nolock) on cho.cho_id = opr.fsl_choId where pod.claimId in ( ) and pod.ownerId = and pod.ownerType ='MFR' and pod.operatorName is not null and pod.operatorName like '%CUSTOMER%' and nullif( pod.operatorAffiliateNbr, '' ) is not null and ( opr.operatorId is null or cho.cho_name like 'CUSTOMER ______' or opr.companyName like 'CUSTOMER ______' ) group by pod.operatorName, pod.operatorAffiliateNbr order by pod.operatorName, pod.operatorAffiliateNbr, activityDate select fsl_choId, operatorId, companyName from tbl_OPR_CLientOperators with (nolock) where ownerId = 226 and fsltablecode = 'MSC' and mfrCustNum = and fsl_choId > 0 UPDATE tbl_OPR_ClientOperators SET FSL_choId = 0, fsl_choIdStatus = 'X', fsl_choIdDate = , fsl_choIdBy = -1, oprParentCo = null, independentYN = 1, oprCompanyType = '0' WHERE OwnerID = AND FSLTableCode = 'MFR' AND operatorId = and fsl_choId > 0

Legacy Mapping Issue Resolved

select affiliationId, partnerId from tbl_CRM_Affiliations with (nolock) where ownerId = and ownerType = 'MFR' and orgId = and orgType = 'OPR' and partnerType = 'OPR' and partnerAffiliateNbr = select min( crmActiveDate ) crmActiveDate, max( crmDeactiveDate ) crmDeactiveDate from tbl_OPR_ClientOperators with (nolock) where ownerId = 612 and fsltablecode = 'CHO' and mfrCustNum = insert into tbl_CRM_Affiliations ( ownerId, ownerType, orgId, orgType, partnerId, partnerType, affiliationType, affiliationDate, deaffiliationDate, affiliationStatus, partnerAffiliateNbr, sourceId, sourceType, recordDate, recordSource ) values( , 'MFR', , 'OPR', , 'OPR', 'GPO', , ,'A''I', , -1, 'SYS', , 'podMaskedLocationPatch.cfm' )
Added #_r.recordCount# affiliation record
No Entegra Membership found for #htmleditformat( operatorAffiliateNbr )#
update tbl_CRM_Affiliations set partnerId = , updateDate = where ownerId = and ownerType = 'MFR' and orgId = and orgType = 'OPR' and partnerType = 'OPR' and partnerAffiliateNbr = and affiliationId in ( ) and partnerId !=
Updated #_r.recordCount# affiliation record(s)
Confirmed #qmd_checkEntegraAffiliation.recordCount# affiliation record(s)
update tbl_TPM_ProofOfDelivery set operatorId = , flagged = case when flagComment = '' then 'N' else flagged end, flagComment = case when flagComment = 'Insufficient Operator Data' then null else flagComment end where ownerId = and ownerType = 'MFR' and claimId in () and coalesce( operatorId, -1 ) != and operatorName = and operatorAffiliateNbr =
Updated #_r.recordCount# POD record(s)
select pod.proofOfDeliveryId from tbl_TPM_ProofOfDelivery pod where ownerId = and ownerType = 'MFR' and claimId in () and operatorId > 0 and operatorName = and operatorAffiliateNbr =
#_notFixedRecords# POD Records NOT Fixed
#operatorName# #operatorAffiliateNbr# #_buyersEdgeCode# #_patch# #_newOperatorId# #_patchedRecords# #_resetRecords# #_notFixedRecords#
select companyName, recordSource, operatorId from tbl_OPR_CLientOperators opr with (nolock) where ownerId = and fsltablecode = 'MFR' and ltrim( companyName ) like 'CUSTOMER%' and oprCompanyType = '0' and not exists ( select * from tbl_TPM_ProofOfDelivery pod with (nolock) where pod.ownerId = opr.ownerId and pod.ownerType = opr.fsltablecode and pod.operatorId = opr.operatorId ) delete opr from tbl_OPR_CLientOperators opr where ownerId = and fsltablecode = 'MFR' and ltrim( companyName ) like 'CUSTOMER%' and oprCompanyType = '0' and not exists ( select * from tbl_TPM_ProofOfDelivery pod with (nolock) where pod.ownerId = opr.ownerId and pod.ownerType = opr.fsltablecode and pod.operatorId = opr.operatorId )
#_dr.recordCount# Unused Records Deleted
select operatorId, fsl_choId, companyName, address, city, state, zipcode, ( select count(*) from tbl_TPM_ProofOfDelivery pod with (nolock) where pod.ownerId = opr.ownerId and pod.ownertype= opr.fsltablecode and pod.operatorId = opr.operatorId ) as podLines from tbl_OPR_CLientOperators opr with (nolock) where ownerId = and fsltablecode = 'MFR' and ltrim( companyName ) like 'CUSTOMER%' and oprCompanyType = '0'

Updated #_podRecordsUpdated# POD records