select s.ownerid, s.fsl_TableCode, s.skuid, s.sku, s.skudesc, s.discontinued, s.discontinueDate, s.endAvailabilityDate from tbl_PRD_SKus s with (nolock) where fsl_tablecode = and s.ownerId = and ( s.discontinueDate <= getDate() or s.endAvailabilityDate <= getDate() ) and s.discontinued <> 'Y' order by sku update tbl_PRD_SKus set discontinued = 'Y' where fsl_tablecode = and ownerId = and skuid = select p.ownerId, p.fsl_tableCode, p.prodid, p.product, p.shortDesc from tbl_PRD_Products p with (nolock) where p.fsl_tableCode = and p.ownerId = and p.focusSkuEndDate <= getDate() order by p.product update tbl_PRD_Products set focusProduct = '', focusSkuEndDate = null where fsl_tableCode = and ownerId = and prodid = select ownerId, fsl_tableCode, skuid, sku, skuDesc from tbl_PRD_Skus with (nolock) where fsl_tableCode = and ownerId = and focusSkuEndDate <= getDate() update tbl_PRD_Skus set focusProduct = null, focusSkuEndDate = null where fsl_tableCode = and ownerId = and skuid =
No expired discontinued skus, product focus or sku focus records found to update.
--->