Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='ActivateFICSADC20250606'; 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 System_Default where Default_name = 'main_store_id' and default_value in (7,8,192,245,252,157,188,200,225,268,284,315,122)) != 0) begin update SystemSetting set SettingValueBit =1 where SettingKey in ('FIC','CMSModule'); update SystemSetting set SettingValueBit = 0 where SettingKey in ('BuyShopCalculatorEnabled','GoldCalculator'); end; Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'ActivateFICSADC20250606'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO