Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='StoreDetailUpdate31012025'; if @@ROWCOUNT!=0 BEGIN RAISERROR('THIS SCRIPT HAS ALREADY BEEN RUN ON THIS SERVER, CANNOT CONTINUE, PLEASE CONTACT DEV',11,1); RETURN; END GO declare @StoreId int; set @StoreId = (select default_value from system_default where Default_Name = 'Main_store_id'); If(@StoreId in (164,90,43,27,76,262,26,106,131,162,127,251,96,110,118,126)) begin update System_Default set Default_Value = 1 where Default_Name = 'ISJV'; update SystemSetting set SettingValueBit = 1 where SettingKey in ('SSBAutoExtension','SSBOnlineExtension'); update store_detail set [Owner] ='', email_address = ''; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Adderley Street' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480637396',TV_display_licence_No='480633981' where @StoreID=96; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Amalinda' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480637701',TV_display_licence_No='480634161' where @StoreID=76; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Beacon Bay' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480637800',TV_display_licence_No='480634666' where @StoreID=90; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Caxton Street' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480637990',TV_display_licence_No='480634880' where @StoreID=26; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Chatsworth' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638089',TV_display_licence_No='480635325' where @StoreID=106; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Cleary Park' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638154',TV_display_licence_No='480635515' where @StoreID=162; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Eerste River' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638238',TV_display_licence_No='480635622' where @StoreID=110; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Joe Slovo' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638261',TV_display_licence_No='480636018' where @StoreID=164; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Khayelitsha' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638303',TV_display_licence_No='480636141' where @StoreID=118; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Lorrainne Gardens' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638386',TV_display_licence_No='480636505' where @StoreID=262; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Mdantsane Mall' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638519',TV_display_licence_No='480636661' where @StoreID=251; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Mitch Promenade' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638535',TV_display_licence_No='480636844' where @StoreID=126; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Mitch Town Centre' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638584',TV_display_licence_No='480637065' where @StoreID=127; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Newton Park' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638642',TV_display_licence_No='480637214' where @StoreID=43; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Parow' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638683',TV_display_licence_No='480637388' where @StoreID=131; update Store_Detail set Trading_Entitiy_Name = 'Cash Crusaders Vincent' , Trading_as_name='Cash Crusaders Stores (Pty) Ltd', Reg_Number='2020/027120/07',Vat_number='4270290184', NCC_Ref_No='NCRCP18105',TV_Dealers_Licence_No='480638725',TV_display_licence_No='480637578' where @StoreID=27; end Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'StoreDetailUpdate31012025'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO