update stage set stage.sku_skuId = s.skuid, stage.custom_2 = s.sku, stage.custom_3 = s.skudesc, stage.custom_4 = s.packsizeDesc from tbl_IMPORT_ProductData stage inner join tbl_PRD_Skus s on stage.sku_sku = s.sku and s.mfrid = stage.sku_MfrId and s.fsl_TableCode = 'MFR' where stage.eai_batchid = and nullif(stage.sku_sku,'') IS NOT NULL update stage set stage.sku_skuId = s.skuid, stage.custom_2 = s.sku, stage.custom_3 = s.skudesc, stage.custom_4 = s.packsizeDesc from tbl_IMPORT_ProductData stage inner join tbl_PRD_Skus s on #attributes.datasource#.dbo.RemoveChars(stage.sku_sku,'32,45') = #attributes.datasource#.dbo.RemoveChars(s.sku,'32,45') and s.mfrid = stage.sku_MfrId and s.fsl_TableCode = 'MFR' where stage.eai_batchid = and nullif(stage.sku_sku,'') IS NOT NULL and stage.sku_skuId IS NULL update stage set stage.sku_skuId = s.skuid, stage.custom_2 = s.sku, stage.custom_3 = s.skudesc, stage.custom_4 = s.packsizeDesc from tbl_IMPORT_ProductData stage inner join tbl_PRD_Packaging p on stage.sku_sku = p.scc14 and p.fsl_TableCode = 'MFR' inner join tbl_PRD_SKus s on s.skuid = p.linkid and p.linkType = 'SKU' and stage.sku_MfrId = s.mfrid where stage.eai_batchid = and nullif(stage.sku_sku,'') IS NOT NULL and nullif(p.scc14,'') IS NOT NULL and stage.sku_skuId IS NULL