update tmp set tmp.prod_mfrid = , tmp.sku_mfrid = from tbl_IMPORT_ProductData tmp where tmp.ownerType = and tmp.ownerId = and tmp.eai_batchId = update stage set stage.sku_mfrID = bpc.objectId, stage.prod_mfrID = bpc.objectId from tbl_IMPORT_ProductData stage inner join tbl_IMPORT_Aliases bpc on stage.mfr_mfrName = bpc.alias and bpc.ownerid = stage.ownerId and bpc.ownerType = stage.ownerType where stage.eai_batchid = and stage.ownerid = and stage.ownerType = and bpc.objectType = 'MFRID' update stage set stage.sku_skuId = -1 from tbl_IMPORT_ProductData stage where stage.eai_batchid = and stage.ownerid = and stage.ownerType = and ( nullif(stage.prod_product,'') is not null or nullif(stage.prod_shortDesc,'') is not null ) and ( nullif(stage.sku_sku,'') is null or nullif(stage.sku_skuDesc,'') is null ) update p set focusProduct = 'N', lastupdated = from tbl_PRD_Products p where p.fsl_tableCode = and p.ownerId = update s set focusProduct = '', lastupdate = from tbl_PRD_Skus s where s.fsl_tableCode = and s.ownerId = with Level2Results as ( select distinct tmp.mfr_mfrName MFR_Name, p.prodid, p.product, p.shortdesc, p.focusProduct old_focus, tmp.custom_6 new_focus from tbl_IMPORT_ProductData tmp inner join tbl_PRD_Products p on p.prodid = tmp.prod_prodid and p.ownerid = tmp.ownerid and p.fsl_TableCode = tmp.ownerType where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and tmp.sku_skuId = -1 and nullif(sku_sku,'') is null and tmp.custom_6 IN ('Y','N') -- and p.focusProduct <> tmp.custom_6 ) select * from Level2Results order by product; update p set p.focusProduct = tmp.custom_6, lastupdate = from tbl_IMPORT_ProductData tmp inner join tbl_PRD_Products p on p.prodid = tmp.prod_prodid and p.ownerid = tmp.ownerid and p.fsl_TableCode = tmp.ownerType where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and tmp.sku_skuId = -1 and nullif(sku_sku,'') is null and tmp.custom_6 IN ('Y','N') with Level1Results as ( select distinct tmp.mfr_mfrName MFR_Name, p.prodid, p.product, p.shortdesc, s.skuid, s.sku, s.skuDesc, s.focusProduct as old_focus, case when tmp.custom_6 = 'L2' then p.focusProduct + ' (follow L2)' else tmp.custom_6 end as new_focus from tbl_IMPORT_ProductData tmp inner join tbl_PRD_Skus s on s.skuId = tmp.sku_skuId and s.ownerid = tmp.ownerid and s.fsl_TableCode = tmp.ownerType inner join tbl_PRD_Products p on p.prodId = s.prodId and p.ownerid = s.ownerid and p.fsl_TableCode = s.fsl_TableCode where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and coalesce(tmp.sku_skuId,0) > 0 ) select * from Level1Results order by product, sku; update s set s.focusProduct = case when tmp.custom_6 = 'L2' then p.focusProduct else tmp.custom_6 end, lastupdate = from tbl_IMPORT_ProductData tmp inner join tbl_PRD_Skus s on s.skuId = tmp.sku_skuId and s.ownerid = tmp.ownerid and s.fsl_TableCode = tmp.ownerType inner join tbl_PRD_Products p on p.prodId = s.prodId and p.ownerid = s.ownerid and p.fsl_TableCode = s.fsl_TableCode where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and coalesce(tmp.sku_skuId,0) > 0

FOCUS_ITEM_IMPORT Results

All PRODUCT (Level 2) Focus Items Reset to 'N'

All SKU (Level 1) Focus Items Reset to #htmleditFormat("")#

select distinct tmp.mfr_mfrName MFR_Name from tbl_IMPORT_ProductData tmp where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and nullif(tmp.prod_mfrId,0) is null and nullif(tmp.mfr_mfrName,'') is not null select distinct tmp.mfr_mfrName MFR_Name, tmp.prod_prodid, tmp.prod_product, tmp.prod_shortDesc, tmp.custom_6 focus from tbl_IMPORT_ProductData tmp where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and nullif(tmp.prod_prodid,0) is null and tmp.sku_skuId = -1 union select distinct tmp.mfr_mfrName MFR_Name, tmp.prod_prodid, tmp.prod_product, tmp.prod_shortDesc, tmp.custom_6 + ' - invalid focus' as focus from tbl_IMPORT_ProductData tmp where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and tmp.custom_6 NOT IN ('Y','N') and tmp.sku_skuId = -1 order by tmp.mfr_mfrName, tmp.prod_product, tmp.prod_shortDesc select distinct tmp.mfr_mfrName MFR_Name, tmp.prod_product, tmp.prod_shortDesc, tmp.sku_skuId, tmp.sku_sku, tmp.sku_skuDesc from tbl_IMPORT_ProductData tmp where tmp.eai_batchid = and tmp.ownerid = and tmp.ownerType = and nullif(tmp.sku_skuId,0) is null and ( nullif(tmp.sku_sku,'') is not null or nullif(tmp.sku_skuDesc,'') is not null ) order by tmp.mfr_mfrName, tmp.prod_product, tmp.prod_shortDesc, tmp.sku_sku