Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='ReorderSkip202324'; if @@ROWCOUNT!=0 BEGIN RAISERROR('THIS SCRIPT HAS ALREADY BEEN RUN ON THIS SERVER, CANNOT CONTINUE, PLEASE CONTACT DEV',11,1); RETURN; END GO update SystemSetting set SettingValueString = '2023-12-18;2024-02-29' where SettingKey = 'ReorderSkipPeriod'; Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'ReorderSkip202324'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO