leohickstein
6/29/2017 - 6:58 AM

GPA - Reprocessar integração

GPA - Reprocessar integração

declare @retailstoreid varchar(18),
		@taskId numeric(10,0);

set @retailstoreid = 'S1357';
select @taskid = min(taskid) from tm.task where actionid = 14 and AlertConfigId is not null and PriceChangeDate > getdate() - 1;

update stra.ItemPriceChange 
   set integrationstatus = 'A' 
 where pricechangedate > getdate() -1 
   and retailstoreid = @retailstoreid
   and itemid not in (select distinct itemid 
                        from tm.taskitem
					   where taskid >= @taskId 
					     and retailstoreid = @retailstoreid);