Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='FACPricingIssueFix'; if @@ROWCOUNT!=0 BEGIN RAISERROR('THIS SCRIPT HAS ALREADY BEEN RUN ON THIS SERVER, CANNOT CONTINUE, PLEASE CONTACT DEV',11,1); RETURN; END GO declare @StoreId int; set @StoreId = (select default_value from system_default where Default_Name = 'Main_store_id'); If(@StoreId in (3,6,17,24,25,26,35,41,67,70,76,82,86,93,100,111,121,129,142,146,149,155,156,158,162,165,174,182,183,186,199,219,246,276)) begin update pricing set to_date = dateadd(MONTH,1,From_Date) where to_date >'2024-12-31'; end Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'FACPricingIssueFix'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO