BEGIN TRY  
		CREATE TABLE #TempStoreNumbers
		  ( 
			StoreNumber VARCHAR(100),
		  ) 

		INSERT INTO #TempStoreNumbers
		  (StoreNumber)
		VALUES
		('12'),
		('35'),
		('60'),
		('119'),
		('120'),
		('153'),
		('159'),
		('168'),
		('174'),
		('328'),
		('368'),
		('462'),
		('487'),
		('509'),
		('570'),
		('618'),
		('633'),
		('652'),
		('663'),
		('677'),
		('678'),
		('687'),
		('699'),
		('713'),
		('724'),
		('746'),
		('753'),
		('780'),
		('789'),
		('791'),
		('792'),
		('794'),
		('830'),
		('835'),
		('836'),
		('842'),
		('848'),
		('849'),
		('856'),
		('859'),
		('868'),
		('875'),
		('905'),
		('950'),
		('1068'),
		('1072'),
		('1076'),
		('1098'),
		('1107'),
		('1116'),
		('1131'),
		('1186'),
		('1218'),
		('1231'),
		('1247'),
		('1248'),
		('1270'),
		('1302'),
		('1305'),
		('1332'),
		('1336'),
		('1359'),
		('1408'),
		('1424'),
		('1425'),
		('1443'),
		('1466'),
		('1479'),
		('1488'),
		('1506'),
		('1507'),
		('1509'),
		('1517'),
		('1544'),
		('1564'),
		('1567'),
		('1573'),
		('1588'),
		('1674'),
		('1724'),
		('1729'),
		('1731'),
		('1749'),
		('1754'),
		('1756'),
		('1760'),
		('1793'),
		('1797'),
		('1813'),
		('1817'),
		('1818'),
		('1851'),
		('1852'),
		('1862'),
		('1891'),
		('1958'),
		('1959'),
		('1960'),
		('1961'),
		('1963'),
		('1997'),
		('2013'),
		('2014'),
		('2015'),
		('2043'),
		('2044'),
		('2117'),
		('2138'),
		('2139'),
		('2145'),
		('2172'),
		('2180'),
		('2181'),
		('2241'),
		('2257'),
		('2317'),
		('2331'),
		('2334'),
		('2335'),
		('2341'),
		('2361'),
		('2449'),
		('2454'),
		('2503'),
		('2509'),
		('2528'),
		('2536'),
		('2564'),
		('2571'),
		('2583'),
		('2650'),
		('2656'),
		('2681'),
		('2682'),
		('2697'),
		('2703'),
		('2723'),
		('2765'),
		('2772'),
		('2794'),
		('2795'),
		('2797'),
		('2805'),
		('2807'),
		('2849'),
		('2850'),
		('2867'),
		('2897'),
		('2909'),
		('2936'),
		('2944'),
		('2957'),
		('2966'),
		('2982'),
		('2986'),
		('3032'),
		('3035'),
		('3059'),
		('3069'),
		('3088'),
		('3092'),
		('3125'),
		('3144'),
		('3175'),
		('3196'),
		('3229'),
		('3243'),
		('3260'),
		('3262'),
		('3272'),
		('3282'),
		('3328'),
		('3331'),
		('3333'),
		('3343'),
		('3349'),
		('3376'),
		('3387'),
		('3388'),
		('3396'),
		('3397'),
		('3404'),
		('3428'),
		('3441'),
		('3446'),
		('3448'),
		('3465'),
		('3490'),
		('3502'),
		('3521'),
		('3614'),
		('3615'),
		('3617'),
		('3644'),
		('3658'),
		('3660'),
		('3664'),
		('3672'),
		('3688'),
		('3703'),
		('3716'),
		('3730'),
		('3739'),
		('3764'),
		('3778'),
		('3791'),
		('3798'),
		('3812'),
		('3820'),
		('3827'),
		('3850'),
		('3953'),
		('3998'),
		('4010'),
		('4012'),
		('4014'),
		('4020'),
		('4082'),
		('4095'),
		('4111'),
		('4251'),
		('4344'),
		('4396'),
		('4544')

		

		DECLARE 
			@store_number VARCHAR(MAX)
 

	

		DECLARE cursor_suggested CURSOR
		FOR SELECT 
				StoreNumber
			FROM 
				#TempStoreNumbers;
 
		OPEN cursor_suggested;
 
		FETCH NEXT FROM cursor_suggested INTO 
			@store_number
 
		WHILE @@FETCH_STATUS = 0
			BEGIN

			SELECT @store_number = RIGHT('00000'+ISNULL(@store_number,''),5)

			declare @EntityID bigint
			select @EntityID = EntityID from tbEntity where StoreNumber = @store_number

			print 'updating IsSuggestedItem flag for store:  ' + @store_number
						--update tbEntityItem
						--set IsSuggestedItem=0
						--where EntityID=@EntityID
						--and ItemID=847

				FETCH NEXT FROM cursor_suggested INTO 
					@store_number
			END;
 
		CLOSE cursor_suggested;
 
		DEALLOCATE cursor_suggested;
		Drop table #TempStoreNumbers

END TRY  

BEGIN CATCH  
		DEALLOCATE cursor_suggested;
		Drop table #TempStoreNumbers;
END CATCH; 


