Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='FH03SeasonalJan2025'; if @@ROWCOUNT!=0 BEGIN RAISERROR('THIS SCRIPT HAS ALREADY BEEN RUN ON THIS SERVER, CANNOT CONTINUE, PLEASE CONTACT DEV',11,1); RETURN; END GO If((select count(0) from SeasonalProduct where HQ_Product_Id = 23421) = 0) begin insert into SeasonalProduct (hq_product_id,frommonth,tomonth) values (23421,4,8); end; Delete from SeasonalProduct where HQ_Product_Id in (873,7506,7507); Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'FH03SeasonalJan2025'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO