select * from tbl_IMPORT_OperatorPurchasing where eai_batchId = and eai_lineNumber = 1 select distinct external_id_type, external_id_owner from tbl_IMPORT_OperatorPurchasing where eai_batchId = and nullif( external_id_type, '' ) is not null and external_id_type <> 'INT' and external_id_type <> 'MDM' select operatorId from tbl_OPR_ClientOperators where ownerId = and fsltablecode = and companyName = and crmActive = 'Y' and oprCompanyType = select o.operatorId from tbl_OPR_ClientOperators o inner join tbl_CHO_Operators c on c.cho_id = o.fsl_choId where o.ownerId = and o.fsltablecode = and o.crmActive = 'Y' and o.oprCompanyType = and ( c.cho_name = or c.cho_dbaName = ) select broker_id from tblBrokers where broker_name = or BrokerAbbrevName = select mfr_id from tblManufacturers where mfr_name = or MFRAbbrev_Name = select * from qmd_pt where hireStatus in ( 'A','P' ) update tbl_IMPORT_OperatorPurchasing set fseExternalIdRefId = where eai_batchId = and external_id_type = and external_id_owner = update tbl_IMPORT_OperatorPurchasing set fseInclude = 'N', fseExternalIdRefId = 0 where eai_batchId = and external_id_type = and external_id_owner =
Load Halted - Unresolved External Id References
Type Owner Status
#htmleditformat( external_id_type )# #htmleditformat( external_id_owner )# #htmleditformat( external_id_status )#

Multiple Matches - The value in EXTERNAL_ID_OWNER matched more than one Manufacturer by Manufacturer Name or Manufacturer Abbreviation in the the MFR Profile Database

Unsupported Type - The value in EXTERNAL_ID_TYPE is invalid and must be MFR if the EXTERNAL ID mapping/setting behaviour is to be used

Not Found - The value in EXTERNAL_ID_OWNER did not match a Manufacturer by Manufacturer Name or Manufacturer Abbreviation in the the MFR Profile Database

MFR Not Active/Pending - The value in EXTERNAL_ID_OWNER matches a Manufacturer but that Manufacturer is not in the clients Manufacturer Portfolio with at least one MFR Territory with a hire status of Active or Pending

No Territory Resources - The value in EXTERNAL_ID_OWNER matches a Manufacturer but that Manufacturer is not in the clients Manufacturer Portfolio with at least one MFR Territory with a hire status of Active or Pending

select distinct product_manufacturer from tbl_IMPORT_OperatorPurchasing where ownerId = and ownerType = and eai_batchId = select mfr_id from tblManufacturers where mfr_name = select mfr_id from tblManufacturers where mfrabbrev_name = update tbl_IMPORT_OperatorPurchasing set fseMfrId = where ownerId = and ownerType = and eai_batchId = and product_manufacturer = select distinct fseMfrId, product_code, product_type from tbl_IMPORT_OperatorPurchasing where ownerId = and ownerType = and eai_batchId = and COALESCE(product_type,'SKU') <> 'PRD' select distinct fseMfrId, product_code, product_type from tbl_IMPORT_OperatorPurchasing where ownerId = and ownerType = and eai_batchId = and product_type = 'PRD' select s.sku, s.skuId, p.prodId from tbl_PRD_SKUS s inner join tbl_PRD_Products p on p.prodId = s.prodId and p.ownerId = s.ownerId and p.fsl_tablecode = s.fsl_tablecode where s.sku like and s.inactive = '0' and s.ownerId = and s.fsl_tablecode = and s.mfrId = update tbl_IMPORT_OperatorPurchasing set fseSkuId = , fseSku = , fseProdId = where eai_batchId = and ownerId = and ownerType = and product_code = and fseMfrId = select distinct s.sku, s.skuId, p.prodId from tbl_PRD_SKUS s inner join tbl_PRD_CustomerSkus cs on cs.skuId = s.skuId and cs.linkType = 'SKU' and cs.ownerId = s.ownerId and cs.fsl_tablecode = s.fsl_tablecode inner join tbl_PRD_Products p on p.prodId = s.prodId and p.ownerId = s.ownerId and p.fsl_tablecode = s.fsl_tablecode where s.inactive = '0' and s.ownerId = and s.fsl_tablecode = and s.mfrId = and cs.customerSku in ( ) and cs.customerType in ( 'PDST', 'DST' ) update tbl_IMPORT_OperatorPurchasing set fseSkuId = , fseSku = , fseProdId = where eai_batchId = and ownerId = and ownerType = and product_code = and fseMfrId = select p2.ProdId from tbl_PRD_Products p inner join tbl_PRD_Products p2 on p.prodId = p2.mfrProdId and p2.ownerid = and p2.fsl_tablecode = where p.product like and p.ownerid = and p.fsl_tableCode = 'MFR' select p.ProdId from tbl_PRD_Products p where p.product like and p.ownerid = and p.fsl_tableCode = and p.mfrid = select p.ProdId from tbl_PRD_Products p where p.product like and p.ownerid = and p.fsl_tableCode = select p.prodId from tbl_PRD_Products p where p.product like and p.inactive = '0' and p.ownerId = and p.fsl_tablecode = and p.mfrId = update tbl_IMPORT_OperatorPurchasing set fseProdId = where eai_batchId = and ownerId = and ownerType = and product_code = and fseMfrId = select distinct distributor_id from tbl_IMPORT_OperatorPurchasing where nullif( distributor_id, '' ) is not null and ownerId = and ownertype = and eai_batchId = select distinct cdr.cdr_recordId, ter.territoryId from tbl_CDR_Distributors cdr inner join tbl_TER_Territories ter on ter.territoryId = cdr.cdr_territoryId and ter.ownerId = cdr.ownerId and ter.fsl_tablecode = cdr.fsl_tablecode left outer join tbl_CDR_DstCodes cdrc on cdrc.cdr_RecordId = cdr.cdr_recordId and cdrc.ownerId = cdr.ownerId and cdrc.ownerType = cdr.fsl_tablecode where cdr.ownerId = and cdr.fsl_tablecode = and ( cdr.cdr_dstcode = or cdrc.cdr_dstcode = ) and cdr.crmActive = 'Y' update tbl_IMPORT_OperatorPurchasing set fseDistributorId = , fseTerritoryId = where ownerId = and ownertype = and eai_batchId = and fseDistributorId is null and fseTerritoryId is null and distributor_id = select distinct company_territory from tbl_IMPORT_OperatorPurchasing where nullif( company_territory, '' ) is not null and ownerId = and ownertype = and eai_batchId = select territoryId from tbl_TER_Territories where internalSalesId = and ownerId = and fsl_tablecode = select territoryId from tbl_TER_Territories where name = and ownerId = and fsl_tablecode = update tbl_IMPORT_OperatorPurchasing set fseTerritoryId = where ownerId = and ownertype = and eai_batchId = and fseTerritoryId is null and company_territory = select distinct left( fseZipCode, 3 ) zipcode_3d from tbl_IMPORT_OperatorPurchasing where eai_batchId = and ownerId = and ownerType = and fseZipCode is not null and fseTerritoryId is null update tbl_IMPORT_OperatorPurchasing set fseTerritoryId = where eai_batchId = and ownerId = and ownerType = and left( fseZipCode, 3 ) = and fseTerritoryId is null select distinct external_id, external_id_owner, fseTerritoryId from tbl_IMPORT_OperatorPurchasing where eai_batchId = and ownerId = and ownerType = and external_id_type = 'MDM' and nullif( external_id, '' ) is not null select operatorId, territoryId, crmActive from tbl_OPR_ClientOperators o where o.mdmId = and o.mdmType = and o.ownerId = and o.fsltablecode = order by operatorId update tbl_IMPORT_OperatorPurchasing set fseOperatorId = , fseTerritoryId = where eai_batchId = and ownerId = and ownerType = and external_id_type = 'MDM' and external_id_owner = and external_id = and nullif( external_id, '' ) is not null and fseOperatorId is null update tbl_IMPORT_OperatorPurchasing set fseInclude = 'N' where eai_batchId = and ownerId = and ownerType = and external_id_type = 'MDM' and external_id_owner = and external_id = and nullif( external_id, '' ) is not null and fseOperatorId is null select fseExternalIdRefId, external_id_type, external_id from tbl_IMPORT_OperatorPurchasing where eai_batchId = and ownerId = and ownerType = and fseExternalIdRefId > 0 and nullif( external_id, '' ) is not null and fseOperatorId is null select distinct opr.operatorId from tbl_BRO_PrincipalOperators po inner join tbl_OPR_ClientOperators opr on opr.operatorId = po.operatorId and opr.ownerId = po.ownerId inner join tbl_BRO_PrincipalTerritories pt on pt.principalTerritoryId = po.principalTerritoryId inner join tbl_BRO_principals p on p.principalId = pt.principalId and p.ownerId = po.ownerId and p.ownerType = po.ownerType where p.ownerId = and p.ownerType = and p.mfrId = and po.mfrCustNbr = update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and external_id = and external_id_type = and fseExternalIdRefId = select distinct s.external_id, s.external_id_type, s.fseExternalIdRefId, opr.operatorId, opr.territoryId from tbl_IMPORT_OperatorPurchasing s inner join tbl_OPR_ClientOperators opr on opr.fsltablecode = s.ownerType and opr.ownerId = s.ownerId and opr.mfrCustNum = s.external_id where s.fseInclude = 'Y' and s.external_id_type = 'MFR' and s.fseExternalIdRefId is not null and nullif( s.external_id, '' ) is not null and s.eai_batchId = update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and external_id = and external_id_type = and fseExternalIdRefId = and fseOperatorId is null select distinct s.external_id, s.external_id_type, s.fseExternalIdRefId, opr.operatorId, opr.territoryId from tbl_IMPORT_OperatorPurchasing s inner join tbl_OPR_ClientOperators opr on opr.fsltablecode = s.ownerType and opr.ownerId = s.ownerId and opr.operatorId = convert( int, s.external_id ) where s.fseInclude = 'Y' and s.external_id_type = 'INT' and s.fseExternalIdRefId is null and isNumeric( s.external_id ) = 1 and s.eai_batchId = update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and external_id = and external_id_type = and fseExternalIdRefId is null and fseOperatorId is null select distinct i.external_id, i.external_id_type, i.fseExternalIdRefId, o.operatorId, o.territoryId from tbl_IMPORT_OperatorPurchasing i inner join tbl_IMPORT_Aliases a on a.ownerId = i.ownerId and a.ownerType = i.ownerType and a.objectType = 'OPR' and a.alias = 'M:#qmd_batch.ownerId#;B:' + convert( varchar, i.fseExternalIdRefId ) + ';O:' + i.external_id inner join tbl_OPR_ClientOperators o on o.ownerId = a.ownerId and o.fsltablecode = a.ownerType and o.operatorId = a.objectId where i.ownerId = and i.ownerType = and i.eai_batchId = and i.external_id_type = 'BRO' and nullif( i.external_id, '' ) is not null and i.fseExternalIdRefId is not null and i.fseOperatorId is null update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and external_id = and external_id_type = and fseExternalIdRefId = and fseOperatorId is null select distinct s.external_id, s.external_id_type, s.fseExternalIdRefId, opr.operatorId, opr.territoryId from tbl_IMPORT_OperatorPurchasing s inner join tbl_CRM_Affiliations a on a.partnerType = 'OPR' and a.affiliationType = s.external_id_type and a.orgtype = 'OPR' and a.orgId = s.fseExternalIdRefId and a.partnerAffiliateNbr = s.external_id and a.affiliationStatus = 'A' inner join tbl_OPR_ClientOperators opr on opr.fsltablecode = s.ownerType and opr.ownerId = s.ownerId and opr.operatorId = a.partnerId where s.fseInclude = 'Y' and s.external_id_type = and s.fseExternalIdRefId is not null and nullif( s.external_id, '' ) is not null and s.eai_batchId = update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and ownerId = and ownerType = and external_id = and external_id_type = and fseExternalIdRefId = and fseOperatorId is null select distinct company_name, company_address, company_city, company_state, company_zip, fseTerritoryId from tbl_IMPORT_OperatorPurchasing where eai_batchId = and fseOperatorId is null and company_name is not null and company_address is not null and company_city is not null and company_state is not null and company_zip is not null and fseInclude = 'Y' and nullif( external_id_type, '' ) is null select territoryId from tbl_TER_Territories where internalSalesId = and ownerId = and fsl_tablecode = select territoryId from tbl_TER_Territories where name = and ownerId = and fsl_tablecode = ---> update tbl_IMPORT_OperatorPurchasing set fseOperatorId = where eai_batchId = and fseOperatorId is null and fseInclude = 'Y' and company_Name = and company_Address = and company_City = and company_zip = and company_state = and fseTerritoryId = and nullif( external_id_type, '' ) is null update tbl_IMPORT_OperatorPurchasing set fseInclude = 'N' where eai_batchId = and fseOperatorId is null and fseInclude = 'Y' and company_Name = and company_Address = and company_City = and company_zip = and company_state = and fseTerritoryId = and nullif( external_id_type, '' ) is null update tbl_IMPORT_OperatorPurchasing set fseInclude = 'N' where eai_batchId = and fseOperatorId is null and fseInclude = 'Y' and company_Name = and company_Address = and company_City = and company_zip = and company_state = and fseTerritoryId = and nullif( external_id_type, '' ) is null select distinct not_buying_reason from tbl_IMPORT_OperatorPurchasing where eai_batchId = and ownerId = and ownerType = and nullif( not_buying_reason, '' ) is not null select reasonId from tbl_CRM_NoSaleReasons where ownerId = and ownerType = and reasonName = update tbl_IMPORT_OperatorPurchasing set fseNoSaleReasonId = where eai_batchId = and ownerId = and ownerType = and not_buying_reason = select distinct i.supplier , i.fseMfrId from tbl_IMPORT_OperatorPurchasing i where i.eai_batchId = and i.supplier_status = 'COMPETITOR' and nullif( i.supplier, '' ) is not null and i.fseMfrId is not null select competitorId from tbl_CMP_Companies where ownerId = and ownertype = and companyName = select objectId as competitorId from tbl_IMPORT_Aliases where ownerId = and ownertype = and objectType = 'CMP' and alias = select pc.competitorId, pcm.mfr_name from tbl_BRO_PrincipalCompetitors pc inner join tbl_BRO_Principals ppl on ppl.principalId = pc.principalId inner join tblManufacturers pcm on pcm.mfr_id = pc.mfrId where ppl.ownerId = and ppl.ownerType = and pcm.mfr_name = and ppl.mfrId = update i set i.fseCompetitorId = from tbl_IMPORT_OperatorPurchasing i where i.eai_batchId = and i.supplier_status = 'COMPETITOR' and i.fseCompetitorId is null and i.supplier = and i.fseMfrId = select eai_importId, eai_lineNumber, fseOperatorId, fseSkuId, fseProdId, fseNoSaleReasonId, fseCompetitorId, purchasing_volume, rtrim( purchasing_frequency ) purchasing_frequency, rtrim( purchasing_uom ) purchasing_uom, rtrim( purchasing_status ) purchasing_status, rtrim( supplier_status ) supplier_status, supplier, general_comments, supplier_sku, product_type, fseMFRid from tbl_IMPORT_OperatorPurchasing where eai_batchId = and ownerId = and ownerType = and fseOperatorId is not null and ( (COALESCE(product_type,'SKU') <> 'PRD' and fseSkuId is not null) or (product_type = 'PRD' and fseProdId is not null) ) order by fseOperatorId, eai_lineNumber select p.prodId, p.product, p.shortDesc, ops.productStatusId from tbl_OPR_ProductStatus ops inner join tbl_PRD_products p on p.prodId = ops.prodId and p.ownerId = and p.fsl_tablecode = inner join tblManufacturers m on m.mfr_id = p.mfrId where ops.ownerId = and ops.ownerType = and ops.operatorId in ( ) update tbl_OPR_ProductStatus set volumeQty = , volumeUnit = , volumeTime = , purchasingStatus = , updateUserId = , updateTimestamp = , updateType = 'EAI', updateId = , skuId = , sourceType = , sourceOther = , sourceCompetitorId = , noSaleReasonId = , generalComments = , competitiveProduct = where ownerId = and ownerType = and operatorId = and prodId = and productStatusId = insert into tbl_OPR_ProductStatus ( ownerId, ownerType, operatorId, prodId, skuId, mktCategoryId, mktSubCategoryId, skuList, purchasingStatus, volumeQty, volumeUnit, volumeTime, sourceType, sourceOther, sourceCompetitorId, noSaleReasonId, generalComments, competitiveProduct, createUserId, createTimeStamp, updateUserId, updateTimeStamp, updateType, updateId ) values ( , , , , , 0, 0, null, , , , , , , , , , , , , , , 'EAI', ) update tbl_OPR_ProductStatus set volumeQty = , volumeUnit = , volumeTime = , purchasingStatus = , updateUserId = , updateTimestamp = , updateType = 'EAI', updateId = , skuId = , sourceType = , sourceOther = , sourceCompetitorId = , noSaleReasonId = , generalComments = , competitiveProduct = where ownerId = and ownerType = and operatorId = and prodId = and productStatusId = insert into tbl_OPR_ProductStatus ( ownerId, ownerType, operatorId, prodId, skuId, mktCategoryId, mktSubCategoryId, skuList, purchasingStatus, volumeQty, volumeUnit, volumeTime, sourceType, sourceOther, sourceCompetitorId, noSaleReasonId, generalComments, competitiveProduct, createUserId, createTimeStamp, updateUserId, updateTimeStamp, updateType, updateId ) values ( , , , , , 0, 0, null, , , , , , , , , , , , , , , 'EAI', ) update tbl_IMPORT_OperatorPurchasing set fseProductStatusId = , fseProductStatusStatus = where eai_importId = and ownerId = and ownerType = and eai_batchId =