Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='ReleaseDec2024Week1'; 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 SystemSetting WHERE SettingKey = 'InstantExchangeWarrantyPeriod') = 0 BEGIN INSERT INTO SystemSetting(SettingKey, SettingCategoryId, SettingValueInt, TypeFlag) VALUES('InstantExchangeWarrantyPeriod', 1, 6, 4) END GO UPDATE ReturnQuestion SET [Description] = 'Does the customer have their CashPOS till slip with the correct item and serial number (if applicable) and dated within 6 months from today?' WHERE [Description] = 'Does the customer have their CashPOS till slip with the correct item and serial number (if applicable) and dated within 12 months from today?'; GO Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'ReleaseDec2024Week1'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO