select distinct importId, ownerId, ownerType, fse_partnerId, recordSource, company_id, company_segment, company_name, company_type, company_classification, territory_name_id, company_phone, company_address1, company_address2, company_city, company_state, company_zip, company_last_modify_date, focus_company_indicator, affiliate_nbr, affiliation_type, affiliation_orgNbr from tbl_IMPORT_ClientPartners i where i.recordSource = and i.ownerId = and i.ownerType = and i.company_type = select clientsegid, description from tbl_OPR_ClientSegments where ownerId = and fsl_tablecode = order by sortRank desc select listId from tbl_LST_partnerLists where ownerId = and ownerType = and listName = and listType = 'SYSTEM' and partnerType = 'OPR' SET NOCOUNT OFF INSERT INTO tbl_LST_PartnerLists ( ownerId, ownerType, listName, listType, createdBy, partnerType, locked ) VALUES ( , , , , , , 'Y' ) SELECT listId = @@identity SET NOCOUNT ON select operatorId, companyName from tbl_OPR_ClientOperators where ownerId = and fsltablecode = and crmActive = 'Y' and mfrCustNum = and oprcompanyType =

Affiliate not found for #affiliation_type#:#affiliation_orgNbr#

select clientSegId from qmd_segments where description =
Can't find #company_segment# for #company_Name#:#company_id#
select classificationId from qmd_oprClassifications where name = No classification for #company_classification# - #company_id#
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 partnerId = @@identity set nocount off update tbl_OPR_ClientOperators set mfrCustNum = where operatorId = and ownerId = and fsltablecode = set nocount on insert into tbl_CDR_Distributors ( ownerId, fsl_tablecode, cdr_dstcode, cdr_dstname, cdr_dstaddress1, cdr_dstaddress2, cdr_dstcity, cdr_dststate, cdr_dstzip, recordSource, createDate, lastUpdated, setMethod, focusAccount ) values ( , , , , , , , , , , { fn now() }, , 1, ) select partnerId = @@identity set nocount off update tbl_CRM_affiliations set affiliationStatus = 'A', affiliationDate = { fn now() }, sourceId = -1, sourceType = 'SYS' where affiliationId = and partnerAffiliateNbr = and ownerId = and ownerType = insert into tbl_CRM_Affiliations ( ownerId, ownerType, affiliationType, orgId, orgType, affiliationDate, affiliationStatus, partnerId, partnerType, partnerAffiliateNbr, sourceId, sourceType ) values ( , , , , , , , , , , , ) update tbl_IMPORT_ClientPartners set fse_partnerId = where importId = update tbl_OPR_ClientOperators set mfrCustNum = , crmActive = 'Y' where operatorId = and ownerId = and fsltablecode = update tbl_CDR_Distributors set cdr_dstcode = , crmActive = 'Y' where cdr_recordId = and ownerId = and fsl_tablecode = insert into tbl_LST_PartnerListItems (listId, partnerId ) values( , )
select importId, ownerId, ownerType, fse_partnerId, fse_contactId, 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_ClientPartners ci where ci.recordSource = and ci.ownerId = and ci.ownerType = and ci.fse_partnerId is not null and ci.company_type = and ci.fse_contactId is null select jobFunctionId from qmd_partnerContactJobFunctions where jobFunctionName = 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_CDR_Distributors set primaryContactId = where cdr_recordId = update tbl_IMPORT_ClientOperators set fse_contactId = where importId = select distinct division from tbl_TER_TerritoryLevels where brokerLevel = 1 and ownerId = and fsl_tablecode = update opr set opr.territoryId = t.territoryId from tbl_IMPORT_ClientPartners i inner join tbl_OPR_CLientOperators opr on opr.operatorId = i.fse_partnerId and opr.ownerId = i.ownerId and opr.fsltablecode = i.ownerType and opr.setMethod = 1 left outer join tbl_TER_Territories mappedTerritory on mappedTerritory.territoryId = opr.territoryId and mappedTerritory.ownerId = opr.ownerId and mappedTerritory.fsl_tablecode = opr.fsltablecode inner join tbl_TER_Territories t on t.ownerId = i.ownerId and t.fsl_tablecode = i.ownerType and t.internalSalesId = i.territory_name_id where i.ownerId = and i.ownertype = and i.recordSource = and i.company_type = and mappedTerritory.territoryId is null update opr set opr.territoryId = t.territoryId from tbl_IMPORT_ClientPartners i inner join tbl_OPR_CLientOperators opr on opr.operatorId = i.fse_partnerId and opr.ownerId = i.ownerId and opr.fsltablecode = i.ownerType and opr.setMethod = 1 left outer join tbl_TER_Territories mappedTerritory on mappedTerritory.territoryId = opr.territoryId and mappedTerritory.ownerId = opr.ownerId and mappedTerritory.fsl_tablecode = opr.fsltablecode inner join tbl_TER_Territories t on t.ownerId = i.ownerId and t.fsl_tablecode = i.ownerType and t.name = i.territory_name_id where i.ownerId = and i.ownertype = and i.recordSource = and i.company_type = and mappedTerritory.territoryId is null update cdr set cdr.cdr_territoryId = t.territoryId from tbl_IMPORT_ClientPartners i inner join tbl_CDR_Distributors cdr on cdr.cdr_recordId = i.fse_partnerId and cdr.ownerId = i.ownerId and cdr.fsl_tablecode = i.ownerType and cdr.setMethod = 1 left outer join tbl_TER_Territories mappedTerritory on mappedTerritory.territoryId = cdr.cdr_territoryId and mappedTerritory.ownerId = cdr.ownerId and mappedTerritory.fsl_tablecode = cdr.fsl_tablecode inner join tbl_TER_Territories t on t.ownerId = i.ownerId and t.fsl_tablecode = i.ownerType and t.internalSalesId = i.territory_name_id where i.ownerId = and i.ownertype = and i.recordSource = and i.company_type = and mappedTerritory.territoryId is null update cdr set cdr.cdr_territoryId = t.territoryId from tbl_IMPORT_ClientPartners i inner join tbl_CDR_Distributors cdr on cdr.cdr_recordId = i.fse_partnerId and cdr.ownerId = i.ownerId and cdr.fsl_tablecode = i.ownerType and cdr.setMethod = 1 left outer join tbl_TER_Territories mappedTerritory on mappedTerritory.territoryId = cdr.cdr_territoryId and mappedTerritory.ownerId = cdr.ownerId and mappedTerritory.fsl_tablecode = cdr.fsl_tablecode inner join tbl_TER_Territories t on t.ownerId = i.ownerId and t.fsl_tablecode = i.ownerType and t.name = i.territory_name_id where i.ownerId = and i.ownertype = and i.recordSource = and i.company_type = and mappedTerritory.territoryId is null #summaryHTML# #summaryHTML#