Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='HotfixJuly2025Week2'; 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(*) from SystemSetting where SettingKey = 'SingleExtensionMonthlyLimit') = 0 begin insert into SystemSetting(SettingKey, SettingCategoryId, SettingValueInt, SettingValueBit, TypeFlag) values ('SingleExtensionMonthlyLimit', 1, 2, 1, 4) end Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'HotfixJuly2025Week2'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO