leohickstein
8/14/2017 - 1:55 PM

Canção - Forçar atualizar preços gama com base alterados

Canção - Forçar atualizar preços gama com base alterados

select 'UPDATE ra.ItemRetailStore SET SellPrice=' + CAST(stra.newlistprice AS VARCHAR) + ' WHERE RetailStoreId=''' + stra.retailstoreid + ''' AND ItemId=''' + stra.itemid + ''' AND SellPrice=' + CAST(irs.SellPrice AS VARCHAR)
from stra.itempricechange stra
	left join ra.itemretailstore irs on irs.retailstoreid = stra.retailstoreid and irs.itemid = stra.itemid
where stra.pricechangedate='2017-08-13 00:00:00.000' and stra.newlistprice <> irs.sellprice