select sma.brokerId, sma.brokerOfficeId, b.broker_name from tbl_SMA_BrokerOfficeLink sma inner join tblBrokers b on b.broker_id = sma.brokerId where sma.mfr_id = and sma.territoryId = and sma.primaryOffice = 'Y' update tbl_IMPORT_Operators set affiliation_orgType = 'BRO', affiliation_orgNbr = , affiliation_type = 'OPR', fseTerritoryId = , recordSource = where eai_batchId = and ownerId = and ownerType = update i set i.fseOperatorId = a.partnerId from tbl_IMPORT_Operators i inner join tbl_CRM_Affiliations a on a.ownerId = i.ownerId and a.ownerType = i.ownerType and a.affiliationType = i.affiliation_type and a.orgId = i.affiliation_orgNbr and a.orgType = i.affiliation_orgType and a.partnerType = i.affiliation_type where i.eai_batchId = and i.ownerId = and i.ownerType = select clientsegid, description from tbl_OPR_ClientSegments where ownerId = and fsl_tablecode = order by sortRank desc select distinct ownerId, ownerType, fseOperatorId, fseTerritoryId, recordSource, company_segment, company_sub_segment, company_name, territory_id, company_phone, company_address1, company_address2, company_city, company_state, company_zip, company_last_modify_date, affiliate_nbr, affiliation_type, affiliation_orgNbr, affiliation_orgType from tbl_IMPORT_Operators i where i.eai_batchId = and i.ownerId = and i.ownerType = and i.fseOperatorId is null select * from qmd_oprClassifications order by sortRank desc select clientSegId from qmd_segments where description =

NO Segment for #company_segment#::#company_sub_segment#

select opr.operatorId, opr.companyName, opr.city, opr.state, opr.address, opr.address2, opr.zipCode from tbl_OPR_ClientOperators opr left outer join tbl_IMPORT_Operators i on i.fseOperatorId = opr.operatorId and i.ownerId = opr.ownerId and i.ownerType = opr.fsltablecode and i.eai_batchId = and i.fseOperatorStatus is null where opr.ownerId = and opr.fsltablecode = and opr.territoryId = and left( opr.zipCode, 5 ) = and i.fseOperatorId is null Potential match count = #qmd_operatorLookup.recordCount#
queryAddColumn( qmd_operatorLookup, "stdAddress", "varchar", ArrayNew(1) ); queryAddColumn( qmd_operatorLookup, "stdAddress2", "varchar", ArrayNew(1) ); queryAddColumn( qmd_operatorLookup, "companyNameEditDistance", "integer", ArrayNew(1) ); queryAddColumn( qmd_operatorLookup, "addressEditDistance", "integer", ArrayNew(1) ); queryAddColumn( qmd_operatorLookup, "addressEditDistance2", "integer", ArrayNew(1) ); querySetCell( qmd_operatorLookup, "stdAddress", _fseStdStreet, qmd_operatorLookup.currentRow ); querySetCell( qmd_operatorLookup, "companyNameEditDistance", _companyNameDistance, qmd_operatorLookup.currentRow ); querySetCell( qmd_operatorLookup, "addressEditDistance", _addressDistance, qmd_operatorLookup.currentRow ); querySetCell( qmd_operatorLookup, "addressEditDistance2", _addressDistance2, qmd_operatorLookup.currentRow ); StructDelete( variables, "matcher" ); StructDelete( variables, "fseStreetParser" ); StructDelete( variables, "srcStreetParser" ); select * from qmd_operatorLookup where (( addressEditDistance = 0 or addressEditDistance2 = 0 ) and companyNameEditDistance <= 4 ) or (( addressEditDistance <= 1 or addressEditDistance2 <= 1 ) and companyNameEditDistance <= 2 ) or ( companyNameEditDistance = 0 ) order by companyNameEditDistance, addressEditDistance
#qmd_match.companyNameEditDistance# #qmd_match.addressEditDistance# #qmd_match.addressEditDistance2#
BRO #company_name# #company_address1# #company_address2# #company_city# #company_state# #company_zip#
MFR #qmd_match.operatorId# #qmd_match.companyName# #qmd_match.address# #qmd_match.Address2# #qmd_match.City# #qmd_match.State# #qmd_match.ZipCode#
update tbl_IMPORT_Operators set fseOperatorId = , fseOperatorStatus = 'M', fseSegmentId = , company_zip = where eai_batchId = and ownerId = and ownerType = and affiliate_nbr = update tbl_IMPORT_Operators set fseOperatorStatus = 'A', fseSegmentId = , company_zip = where eai_batchId = and ownerId = and ownerType = and affiliate_nbr =
set nocount on insert into tbl_OPR_ClientOperators ( ownerId, fsltablecode, companyName, mfrcustnum, address, address2, city, state, zipcode, recordSource, datecreated, lastUpdated, oprSegment, independentYn, oprCompanyType, setmethod, classificationId, focusAccount ) values ( , , , , , , , , , , {fn now() }, , , , , , , ) select operatorId = @@identity set nocount off update tbl_OPR_ClientOperators set mfrCustNum = where operatorId = and ownerId = and fsltablecode = update tbl_IMPORT_Operators set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and affiliate_nbr = set nocount on insert into tbl_CRM_Affiliations ( ownerId, ownerType, affiliationType, orgId, orgType, affiliationDate, affiliationStatus, partnerId, partnerType, partnerAffiliateNbr, sourceId, sourceType ) values ( , , , , , , , , , , , ) select affiliationId = @@identity set nocount off update tbl_IMPORT_Operators set fseAffiliationId = where eai_batchId = and ownerId = and ownerType = and fseOperatorId =
select eai_importId, eai_batchId, ownerId, ownerType, fseOperatorId, fseContactId, recordSource, contact_last_name, contact_first_name, contact_fax, contact_phone, contact_mobile_phone, contact_email, contact_last_modify_date, primary_contact_indicator, contact_title, contact_job_function from tbl_IMPORT_Operators ci where ci.eai_batchId = and ci.ownerId = and ci.ownerType = and ci.fseOperatorId is not null and ci.fseContactId is null select m.fspro_userid, m.firstName, m.lastName, m.email, m.title, m.caJobFunction, m.phone, m.fax, m.cellPhone from tbl_FSPro_members m left outer join tbl_IMPORT_Operators i on i.fseContactId = fspro_userId and i.ownerId = m.ownerId and i.ownerType = m.fsl_tablecode and i.eai_batchId = where m.ownerId = and m.fsl_tablecode = and m.orgId = and m.orgType = 'OPR' and (( m.firstName = and m.lastName = ) or m.email = ) and i.fseContactId is null select jobFunctionId from qmd_partnerContactJobFunctions where jobFunctionName =

Contact Matched #_contactId# #contact_first_name# #contact_last_name# #contact_email#

update tbl_FSpro_members set firstName = , lastName = , email = , phone = , fax = , cellPhone = , title = , caJobFunction = , lastUpdated = where fspro_userId = and ownerId = and fsl_tablecode= set nocount on insert into tbl_FSPro_members ( firstName, lastName, email, phone, fax, cellPhone, officeAddrSame, createDate, lastUpdated, originalSource, orgId, orgType, ownerId, fsl_tablecode, title, cajobfunction ) values( , , , , , , 1, { fn now() }, , , , , , , , ) select contactId = @@identity set nocount off
update tbl_OPR_ClientOperators set primaryContactId = where operatorId = update tbl_IMPORT_Operators set fseContactId = , fseContactStatus = where eai_importId =
#summaryHTML# #summaryHTML#