Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='BFPRomoOn2024RStores'; 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 (243, 2, 182, 35, 174, 227, 246, 276, 135, 25, 183, 9, 82,199,41,6,38,186,75,69,173,68,54,67,70 )) begin UPDATE promotion set period_start = '2024-11-29', period_end = '2024-12-01', lockdowndate = '2024-11-11' where promotion_id = 283; end Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'BFPRomoOn2024RStores'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO