Print 'Doing pre run Checks to ensure script not already run'; Select * from Script_History where Script_Name='StockItemUpdateSSB29Feb'; 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') update stock_item set unit_cost =121 ,vat =15.78 where @StoreID =1 and Stock_item_ID = 992856 and unit_cost =242; update stock_item set unit_cost =175 ,vat =22.83 where @StoreID =4 and Stock_item_ID = 827520 and unit_cost =350; update stock_item set unit_cost =1165.68 ,vat =152.05 where @StoreID =5 and Stock_item_ID = 296512 and unit_cost =2331.36; update stock_item set unit_cost =271.9 ,vat =35.47 where @StoreID =5 and Stock_item_ID = 297046 and unit_cost =543.81; update stock_item set unit_cost =1448.5 ,vat =188.93 where @StoreID =10 and Stock_item_ID = 2609530 and unit_cost =2897; update stock_item set unit_cost =1392 ,vat =181.57 where @StoreID =11 and Stock_item_ID = 264149 and unit_cost =2784; update stock_item set unit_cost =714 ,vat =93.13 where @StoreID =11 and Stock_item_ID = 264372 and unit_cost =1428; update stock_item set unit_cost =714 ,vat =93.13 where @StoreID =11 and Stock_item_ID = 265870 and unit_cost =1428; update stock_item set unit_cost =483.38 ,vat =63.05 where @StoreID =12 and Stock_item_ID = 1164681 and unit_cost =966.77; update stock_item set unit_cost =362.54 ,vat =47.29 where @StoreID =12 and Stock_item_ID = 1501517 and unit_cost =725.07; update stock_item set unit_cost =2860.6 ,vat =373.12 where @StoreID =12 and Stock_item_ID = 1501770 and unit_cost =5721.19; update stock_item set unit_cost =95 ,vat =12.39 where @StoreID =13 and Stock_item_ID = 1329002 and unit_cost =190; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =14 and Stock_item_ID = 546789 and unit_cost =1500; update stock_item set unit_cost =5500 ,vat =717.39 where @StoreID =15 and Stock_item_ID = 453745 and unit_cost =11000; update stock_item set unit_cost =300 ,vat =39.13 where @StoreID =18 and Stock_item_ID = 825786 and unit_cost =600; update stock_item set unit_cost =175 ,vat =22.83 where @StoreID =18 and Stock_item_ID = 926552 and unit_cost =350; update stock_item set unit_cost =350 ,vat =45.65 where @StoreID =18 and Stock_item_ID = 1518055 and unit_cost =700; update stock_item set unit_cost =325 ,vat =42.39 where @StoreID =18 and Stock_item_ID = 1518129 and unit_cost =650; update stock_item set unit_cost =650 ,vat =84.78 where @StoreID =18 and Stock_item_ID = 1670732 and unit_cost =1300; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =18 and Stock_item_ID = 2017429 and unit_cost =1000; update stock_item set unit_cost =2000 ,vat =260.87 where @StoreID =18 and Stock_item_ID = 2594246 and unit_cost =4000; update stock_item set unit_cost =475 ,vat =61.96 where @StoreID =18 and Stock_item_ID = 2685146 and unit_cost =950; update stock_item set unit_cost =460 ,vat =60 where @StoreID =18 and Stock_item_ID = 2686061 and unit_cost =920; update stock_item set unit_cost =460 ,vat =60 where @StoreID =18 and Stock_item_ID = 2686062 and unit_cost =920; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =19 and Stock_item_ID = 362664 and unit_cost =1500; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =19 and Stock_item_ID = 363267 and unit_cost =1500; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =19 and Stock_item_ID = 363960 and unit_cost =2000; update stock_item set unit_cost =337.5 ,vat =44.02 where @StoreID =20 and Stock_item_ID = 319863 and unit_cost =675; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =20 and Stock_item_ID = 321098 and unit_cost =1000; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =20 and Stock_item_ID = 580317 and unit_cost =2000; update stock_item set unit_cost =400 ,vat =52.17 where @StoreID =20 and Stock_item_ID = 590628 and unit_cost =800; update stock_item set unit_cost =600 ,vat =78.26 where @StoreID =20 and Stock_item_ID = 631968 and unit_cost =1200; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =20 and Stock_item_ID = 631984 and unit_cost =1800; update stock_item set unit_cost =3250 ,vat =423.91 where @StoreID =20 and Stock_item_ID = 632860 and unit_cost =6500; update stock_item set unit_cost =8250 ,vat =1076.09 where @StoreID =20 and Stock_item_ID = 684610 and unit_cost =16500; update stock_item set unit_cost =60 ,vat =7.83 where @StoreID =20 and Stock_item_ID = 685343 and unit_cost =120; update stock_item set unit_cost =100 ,vat =13.04 where @StoreID =20 and Stock_item_ID = 685344 and unit_cost =200; update stock_item set unit_cost =2500 ,vat =326.09 where @StoreID =20 and Stock_item_ID = 685549 and unit_cost =5000; update stock_item set unit_cost =175 ,vat =22.83 where @StoreID =21 and Stock_item_ID = 249166 and unit_cost =350; update stock_item set unit_cost =400 ,vat =52.17 where @StoreID =21 and Stock_item_ID = 249820 and unit_cost =800; update stock_item set unit_cost =3525 ,vat =459.78 where @StoreID =21 and Stock_item_ID = 341532 and unit_cost =7050; update stock_item set unit_cost =2775 ,vat =361.96 where @StoreID =21 and Stock_item_ID = 341533 and unit_cost =5550; update stock_item set unit_cost =1550 ,vat =202.17 where @StoreID =21 and Stock_item_ID = 554760 and unit_cost =3100; update stock_item set unit_cost =800 ,vat =104.35 where @StoreID =21 and Stock_item_ID = 554761 and unit_cost =1600; update stock_item set unit_cost =550 ,vat =71.74 where @StoreID =21 and Stock_item_ID = 554762 and unit_cost =1100; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =21 and Stock_item_ID = 554763 and unit_cost =500; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =21 and Stock_item_ID = 554764 and unit_cost =500; update stock_item set unit_cost =400 ,vat =52.17 where @StoreID =21 and Stock_item_ID = 554765 and unit_cost =800; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =21 and Stock_item_ID = 554766 and unit_cost =1000; update stock_item set unit_cost =2500 ,vat =326.09 where @StoreID =21 and Stock_item_ID = 565031 and unit_cost =5000; update stock_item set unit_cost =2500 ,vat =326.09 where @StoreID =21 and Stock_item_ID = 565032 and unit_cost =5000; update stock_item set unit_cost =5000 ,vat =652.17 where @StoreID =21 and Stock_item_ID = 565033 and unit_cost =10000; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =21 and Stock_item_ID = 565430 and unit_cost =1000; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =22 and Stock_item_ID = 903138 and unit_cost =1000; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =23 and Stock_item_ID = 1871900 and unit_cost =1500; update stock_item set unit_cost =1500 ,vat =195.65 where @StoreID =23 and Stock_item_ID = 1902842 and unit_cost =3000; update stock_item set unit_cost =610 ,vat =79.57 where @StoreID =29 and Stock_item_ID = 291855 and unit_cost =1220; update stock_item set unit_cost =1335.5 ,vat =174.2 where @StoreID =31 and Stock_item_ID = 1195851 and unit_cost =2671; update stock_item set unit_cost =242 ,vat =31.57 where @StoreID =31 and Stock_item_ID = 1246181 and unit_cost =484; update stock_item set unit_cost =1730.65 ,vat =225.74 where @StoreID =34 and Stock_item_ID = 521249 and unit_cost =3461.3; update stock_item set unit_cost =3035 ,vat =395.87 where @StoreID =40 and Stock_item_ID = 712439 and unit_cost =6070; update stock_item set unit_cost =650 ,vat =84.78 where @StoreID =45 and Stock_item_ID = 4149729 and unit_cost =1300; update stock_item set unit_cost =1500 ,vat =195.65 where @StoreID =48 and Stock_item_ID = 1458727 and unit_cost =3000; update stock_item set unit_cost =1500 ,vat =195.65 where @StoreID =49 and Stock_item_ID = 478279 and unit_cost =3000; update stock_item set unit_cost =675 ,vat =88.04 where @StoreID =49 and Stock_item_ID = 596700 and unit_cost =1350; update stock_item set unit_cost =2700 ,vat =352.17 where @StoreID =49 and Stock_item_ID = 618886 and unit_cost =5400; update stock_item set unit_cost =28.12 ,vat =3.67 where @StoreID =52 and Stock_item_ID = 117624 and unit_cost =225; update stock_item set unit_cost =6.25 ,vat =0.82 where @StoreID =52 and Stock_item_ID = 117625 and unit_cost =50; update stock_item set unit_cost =21.88 ,vat =2.85 where @StoreID =52 and Stock_item_ID = 117626 and unit_cost =175; update stock_item set unit_cost =1.88 ,vat =0.25 where @StoreID =52 and Stock_item_ID = 119708 and unit_cost =15; update stock_item set unit_cost =1.88 ,vat =0.25 where @StoreID =52 and Stock_item_ID = 119709 and unit_cost =15; update stock_item set unit_cost =5.62 ,vat =0.73 where @StoreID =52 and Stock_item_ID = 119710 and unit_cost =45; update stock_item set unit_cost =3.75 ,vat =0.49 where @StoreID =52 and Stock_item_ID = 119711 and unit_cost =30; update stock_item set unit_cost =1.25 ,vat =0.16 where @StoreID =52 and Stock_item_ID = 119712 and unit_cost =10; update stock_item set unit_cost =1.25 ,vat =0.16 where @StoreID =52 and Stock_item_ID = 119713 and unit_cost =10; update stock_item set unit_cost =5.62 ,vat =0.73 where @StoreID =52 and Stock_item_ID = 119714 and unit_cost =45; update stock_item set unit_cost =1.25 ,vat =0.16 where @StoreID =52 and Stock_item_ID = 119715 and unit_cost =10; update stock_item set unit_cost =5.62 ,vat =0.73 where @StoreID =52 and Stock_item_ID = 119716 and unit_cost =45; update stock_item set unit_cost =11.25 ,vat =1.47 where @StoreID =52 and Stock_item_ID = 119717 and unit_cost =90; update stock_item set unit_cost =13.75 ,vat =1.79 where @StoreID =52 and Stock_item_ID = 119718 and unit_cost =110; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =57 and Stock_item_ID = 2517594 and unit_cost =2000; update stock_item set unit_cost =255 ,vat =33.26 where @StoreID =57 and Stock_item_ID = 2527725 and unit_cost =510; update stock_item set unit_cost =735 ,vat =95.87 where @StoreID =57 and Stock_item_ID = 2547898 and unit_cost =1470; update stock_item set unit_cost =555 ,vat =72.39 where @StoreID =57 and Stock_item_ID = 2547899 and unit_cost =1110; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =57 and Stock_item_ID = 2588205 and unit_cost =1000; update stock_item set unit_cost =2750 ,vat =358.7 where @StoreID =57 and Stock_item_ID = 2688564 and unit_cost =5500; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =63 and Stock_item_ID = 1278642 and unit_cost =1000; update stock_item set unit_cost =546.75 ,vat =71.32 where @StoreID =64 and Stock_item_ID = 565510 and unit_cost =1093.5; update stock_item set unit_cost =450 ,vat =58.7 where @StoreID =64 and Stock_item_ID = 586999 and unit_cost =900; update stock_item set unit_cost =925 ,vat =120.65 where @StoreID =64 and Stock_item_ID = 609950 and unit_cost =1850; update stock_item set unit_cost =600 ,vat =78.26 where @StoreID =64 and Stock_item_ID = 610362 and unit_cost =1200; update stock_item set unit_cost =325 ,vat =42.39 where @StoreID =64 and Stock_item_ID = 620791 and unit_cost =650; update stock_item set unit_cost =850 ,vat =110.87 where @StoreID =64 and Stock_item_ID = 631307 and unit_cost =1700; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =72 and Stock_item_ID = 1023142 and unit_cost =1000; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =72 and Stock_item_ID = 1056075 and unit_cost =1500; update stock_item set unit_cost =650 ,vat =84.78 where @StoreID =73 and Stock_item_ID = 433037 and unit_cost =1300; update stock_item set unit_cost =350 ,vat =45.65 where @StoreID =73 and Stock_item_ID = 433038 and unit_cost =700; update stock_item set unit_cost =826.7 ,vat =107.83 where @StoreID =79 and Stock_item_ID = 1556479 and unit_cost =1653.39; update stock_item set unit_cost =600.7 ,vat =78.35 where @StoreID =81 and Stock_item_ID = 3008624 and unit_cost =1201.41; update stock_item set unit_cost =2159.98 ,vat =281.74 where @StoreID =81 and Stock_item_ID = 3209717 and unit_cost =4319.95; update stock_item set unit_cost =467.47 ,vat =60.97 where @StoreID =81 and Stock_item_ID = 3209718 and unit_cost =934.94; update stock_item set unit_cost =1100 ,vat =143.48 where @StoreID =87 and Stock_item_ID = 377591 and unit_cost =2200; update stock_item set unit_cost =1900 ,vat =247.83 where @StoreID =91 and Stock_item_ID = 1510678 and unit_cost =3800; update stock_item set unit_cost =425 ,vat =55.43 where @StoreID =92 and Stock_item_ID = 422871 and unit_cost =850; update stock_item set unit_cost =151.06 ,vat =19.7 where @StoreID =95 and Stock_item_ID = 202629 and unit_cost =302.11; update stock_item set unit_cost =300.35 ,vat =39.18 where @StoreID =95 and Stock_item_ID = 204555 and unit_cost =600.7; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =95 and Stock_item_ID = 217695 and unit_cost =1766.39; update stock_item set unit_cost =564.96 ,vat =73.69 where @StoreID =95 and Stock_item_ID = 217696 and unit_cost =1129.93; update stock_item set unit_cost =150 ,vat =19.57 where @StoreID =98 and Stock_item_ID = 307047 and unit_cost =300; update stock_item set unit_cost =3000 ,vat =391.3 where @StoreID =98 and Stock_item_ID = 328299 and unit_cost =2608.7; update stock_item set unit_cost =3000 ,vat =391.3 where @StoreID =98 and Stock_item_ID = 339280 and unit_cost =2608.7; update stock_item set unit_cost =2000 ,vat =260.87 where @StoreID =99 and Stock_item_ID = 2444156 and unit_cost =4000; update stock_item set unit_cost =550 ,vat =71.74 where @StoreID =105 and Stock_item_ID = 210347 and unit_cost =1100; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =108 and Stock_item_ID = 2120656 and unit_cost =1000; update stock_item set unit_cost =1350 ,vat =176.09 where @StoreID =108 and Stock_item_ID = 2771750 and unit_cost =2700; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =108 and Stock_item_ID = 2782405 and unit_cost =1000; update stock_item set unit_cost =1052.68 ,vat =137.31 where @StoreID =109 and Stock_item_ID = 251400 and unit_cost =2105.37; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =109 and Stock_item_ID = 253168 and unit_cost =1766.39; update stock_item set unit_cost =713.7 ,vat =93.09 where @StoreID =109 and Stock_item_ID = 254536 and unit_cost =1427.4; update stock_item set unit_cost =217.5 ,vat =28.37 where @StoreID =112 and Stock_item_ID = 2163954 and unit_cost =435; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =116 and Stock_item_ID = 3113632 and unit_cost =1766.39; update stock_item set unit_cost =724.08 ,vat =94.45 where @StoreID =116 and Stock_item_ID = 3123850 and unit_cost =1448.16; update stock_item set unit_cost =724.08 ,vat =94.45 where @StoreID =116 and Stock_item_ID = 3123851 and unit_cost =1448.16; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =120 and Stock_item_ID = 1163700 and unit_cost =1500; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =120 and Stock_item_ID = 1163701 and unit_cost =1800; update stock_item set unit_cost =1350 ,vat =176.09 where @StoreID =120 and Stock_item_ID = 1163702 and unit_cost =2700; update stock_item set unit_cost =770.5 ,vat =100.5 where @StoreID =122 and Stock_item_ID = 435985 and unit_cost =1541; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =130 and Stock_item_ID = 307080 and unit_cost =500; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =130 and Stock_item_ID = 307081 and unit_cost =500; update stock_item set unit_cost =601 ,vat =78.39 where @StoreID =132 and Stock_item_ID = 980221 and unit_cost =1202; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =132 and Stock_item_ID = 1011864 and unit_cost =2000; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =132 and Stock_item_ID = 1011870 and unit_cost =2000; update stock_item set unit_cost =350 ,vat =45.65 where @StoreID =137 and Stock_item_ID = 195239 and unit_cost =700; update stock_item set unit_cost =400 ,vat =52.17 where @StoreID =137 and Stock_item_ID = 195335 and unit_cost =800; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =139 and Stock_item_ID = 414749 and unit_cost =1500; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =166 and Stock_item_ID = 3520124 and unit_cost =1000; update stock_item set unit_cost =1650 ,vat =215.22 where @StoreID =166 and Stock_item_ID = 3733715 and unit_cost =3300; update stock_item set unit_cost =2295.62 ,vat =299.43 where @StoreID =167 and Stock_item_ID = 3533550 and unit_cost =4591.24; update stock_item set unit_cost =770.2 ,vat =100.46 where @StoreID =167 and Stock_item_ID = 3614796 and unit_cost =1540.4; update stock_item set unit_cost =350 ,vat =45.65 where @StoreID =176 and Stock_item_ID = 273421 and unit_cost =700; update stock_item set unit_cost =1100 ,vat =143.48 where @StoreID =176 and Stock_item_ID = 273422 and unit_cost =2200; update stock_item set unit_cost =300 ,vat =39.13 where @StoreID =176 and Stock_item_ID = 273423 and unit_cost =600; update stock_item set unit_cost =100 ,vat =13.04 where @StoreID =176 and Stock_item_ID = 274173 and unit_cost =200; update stock_item set unit_cost =75 ,vat =9.78 where @StoreID =176 and Stock_item_ID = 274174 and unit_cost =150; update stock_item set unit_cost =150 ,vat =19.57 where @StoreID =180 and Stock_item_ID = 325354 and unit_cost =300; update stock_item set unit_cost =1225 ,vat =159.78 where @StoreID =180 and Stock_item_ID = 357922 and unit_cost =2450; update stock_item set unit_cost =625 ,vat =81.52 where @StoreID =180 and Stock_item_ID = 358248 and unit_cost =1250; update stock_item set unit_cost =2000 ,vat =260.87 where @StoreID =190 and Stock_item_ID = 1890875 and unit_cost =100; update stock_item set unit_cost =1750 ,vat =228.26 where @StoreID =191 and Stock_item_ID = 345440 and unit_cost =3500; update stock_item set unit_cost =1000 ,vat =130.43 where @StoreID =191 and Stock_item_ID = 380065 and unit_cost =2000; update stock_item set unit_cost =883 ,vat =115.17 where @StoreID =201 and Stock_item_ID = 201144 and unit_cost =1766; update stock_item set unit_cost =241.75 ,vat =31.53 where @StoreID =201 and Stock_item_ID = 242327 and unit_cost =483.5; update stock_item set unit_cost =2000 ,vat =260.87 where @StoreID =201 and Stock_item_ID = 265791 and unit_cost =1739.13; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =203 and Stock_item_ID = 2328650 and unit_cost =1766.39; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =206 and Stock_item_ID = 173869 and unit_cost =1800; update stock_item set unit_cost =675 ,vat =88.04 where @StoreID =207 and Stock_item_ID = 275235 and unit_cost =1350; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =211 and Stock_item_ID = 4728428 and unit_cost =1500; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =211 and Stock_item_ID = 4758622 and unit_cost =1800; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =212 and Stock_item_ID = 204532 and unit_cost =500; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =212 and Stock_item_ID = 206741 and unit_cost =1500; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =214 and Stock_item_ID = 1248072 and unit_cost =1766.39; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =217 and Stock_item_ID = 4042586 and unit_cost =1800; update stock_item set unit_cost =1500 ,vat =195.65 where @StoreID =218 and Stock_item_ID = 6191574 and unit_cost =3000; update stock_item set unit_cost =119 ,vat =15.52 where @StoreID =223 and Stock_item_ID = 41562 and unit_cost =238; update stock_item set unit_cost =99.25 ,vat =12.95 where @StoreID =223 and Stock_item_ID = 41563 and unit_cost =198.5; update stock_item set unit_cost =52.99 ,vat =6.91 where @StoreID =223 and Stock_item_ID = 41564 and unit_cost =105.98; update stock_item set unit_cost =198.61 ,vat =25.91 where @StoreID =223 and Stock_item_ID = 41565 and unit_cost =397.22; update stock_item set unit_cost =219.97 ,vat =28.69 where @StoreID =223 and Stock_item_ID = 43169 and unit_cost =439.94; update stock_item set unit_cost =112.36 ,vat =14.66 where @StoreID =223 and Stock_item_ID = 43170 and unit_cost =224.72; update stock_item set unit_cost =120 ,vat =15.65 where @StoreID =223 and Stock_item_ID = 44509 and unit_cost =240; update stock_item set unit_cost =95 ,vat =12.39 where @StoreID =223 and Stock_item_ID = 44510 and unit_cost =190; update stock_item set unit_cost =2115 ,vat =275.87 where @StoreID =223 and Stock_item_ID = 44996 and unit_cost =4230; update stock_item set unit_cost =2000 ,vat =260.87 where @StoreID =224 and Stock_item_ID = 817031 and unit_cost =4000; update stock_item set unit_cost =2125 ,vat =277.17 where @StoreID =226 and Stock_item_ID = 845978 and unit_cost =4250; update stock_item set unit_cost =87.5 ,vat =11.41 where @StoreID =229 and Stock_item_ID = 59251 and unit_cost =350; update stock_item set unit_cost =350 ,vat =45.65 where @StoreID =229 and Stock_item_ID = 61810 and unit_cost =1400; update stock_item set unit_cost =82.5 ,vat =10.76 where @StoreID =229 and Stock_item_ID = 62189 and unit_cost =330; update stock_item set unit_cost =27.5 ,vat =3.59 where @StoreID =229 and Stock_item_ID = 62190 and unit_cost =110; update stock_item set unit_cost =87.5 ,vat =11.41 where @StoreID =229 and Stock_item_ID = 121642 and unit_cost =175; update stock_item set unit_cost =650 ,vat =84.78 where @StoreID =229 and Stock_item_ID = 232752 and unit_cost =1300; update stock_item set unit_cost =85 ,vat =11.09 where @StoreID =229 and Stock_item_ID = 263548 and unit_cost =170; update stock_item set unit_cost =275 ,vat =35.87 where @StoreID =229 and Stock_item_ID = 263549 and unit_cost =550; update stock_item set unit_cost =75 ,vat =9.78 where @StoreID =229 and Stock_item_ID = 637447 and unit_cost =150; update stock_item set unit_cost =100 ,vat =13.04 where @StoreID =229 and Stock_item_ID = 637448 and unit_cost =200; update stock_item set unit_cost =175 ,vat =22.83 where @StoreID =229 and Stock_item_ID = 637449 and unit_cost =350; update stock_item set unit_cost =200 ,vat =26.09 where @StoreID =229 and Stock_item_ID = 637450 and unit_cost =400; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =232 and Stock_item_ID = 151333 and unit_cost =1000; update stock_item set unit_cost =250 ,vat =32.61 where @StoreID =232 and Stock_item_ID = 151717 and unit_cost =500; update stock_item set unit_cost =1500 ,vat =195.65 where @StoreID =237 and Stock_item_ID = 61872 and unit_cost =3000; update stock_item set unit_cost =750 ,vat =97.83 where @StoreID =237 and Stock_item_ID = 65117 and unit_cost =1500; update stock_item set unit_cost =2250 ,vat =293.48 where @StoreID =237 and Stock_item_ID = 65609 and unit_cost =4500; update stock_item set unit_cost =450 ,vat =58.7 where @StoreID =249 and Stock_item_ID = 1317630 and unit_cost =900; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =250 and Stock_item_ID = 467194 and unit_cost =1800; update stock_item set unit_cost =3250 ,vat =423.91 where @StoreID =250 and Stock_item_ID = 497713 and unit_cost =6500; update stock_item set unit_cost =675 ,vat =88.04 where @StoreID =257 and Stock_item_ID = 907037 and unit_cost =1350; update stock_item set unit_cost =1200 ,vat =156.52 where @StoreID =257 and Stock_item_ID = 907038 and unit_cost =2400; update stock_item set unit_cost =600 ,vat =78.26 where @StoreID =257 and Stock_item_ID = 907039 and unit_cost =1200; update stock_item set unit_cost =900 ,vat =117.39 where @StoreID =260 and Stock_item_ID = 2591232 and unit_cost =1800; update stock_item set unit_cost =500 ,vat =65.22 where @StoreID =260 and Stock_item_ID = 3094221 and unit_cost =1000; update stock_item set unit_cost =675 ,vat =88.04 where @StoreID =267 and Stock_item_ID = 824763 and unit_cost =1350; update stock_item set unit_cost =3840 ,vat =500.87 where @StoreID =270 and Stock_item_ID = 19649 and unit_cost =7680; update stock_item set unit_cost =570 ,vat =74.35 where @StoreID =270 and Stock_item_ID = 19650 and unit_cost =1140; update stock_item set unit_cost =320 ,vat =41.74 where @StoreID =270 and Stock_item_ID = 19651 and unit_cost =640; update stock_item set unit_cost =660 ,vat =86.09 where @StoreID =270 and Stock_item_ID = 19652 and unit_cost =1320; update stock_item set unit_cost =2015 ,vat =262.83 where @StoreID =270 and Stock_item_ID = 19653 and unit_cost =4030; update stock_item set unit_cost =1780 ,vat =232.17 where @StoreID =270 and Stock_item_ID = 19654 and unit_cost =3560; update stock_item set unit_cost =415 ,vat =54.13 where @StoreID =270 and Stock_item_ID = 19655 and unit_cost =830; update stock_item set unit_cost =883.2 ,vat =115.2 where @StoreID =279 and Stock_item_ID = 49488 and unit_cost =1766.39; update stock_item set unit_cost =605 ,vat =78.91 where @StoreID =281 and Stock_item_ID = 675795 and unit_cost =1209.99; update stock_item set unit_cost =278.5 ,vat =36.33 where @StoreID =281 and Stock_item_ID = 675796 and unit_cost =557; update stock_item set unit_cost =274.97 ,vat =35.87 where @StoreID =281 and Stock_item_ID = 866409 and unit_cost =549.94; update stock_item set unit_cost =962.47 ,vat =125.54 where @StoreID =281 and Stock_item_ID = 986646 and unit_cost =1924.94; update stock_item set unit_cost =1992.6 ,vat =259.9 where @StoreID =282 and Stock_item_ID = 1436797 and unit_cost =1732.7; update stock_item set unit_cost =1165.68 ,vat =152.05 where @StoreID =283 and Stock_item_ID = 115401 and unit_cost =2331.36; update stock_item set unit_cost =175 ,vat =22.83 where @StoreID =290 and Stock_item_ID = 1117 and unit_cost =350; Print 'Insert into script history if everything else is cool'; Insert into Script_History (RunDate,Script_Name) Values (CURRENT_TIMESTAMP,'StockItemUpdateSSB29Feb'); IF @@ERROR != 0 BEGIN RAISERROR ('UNABLE TO CONTINUE WITH SCRIPT', 11, 1); RETURN; END GO