DECLARE @LastValue INT

SELECT @LastValue = CAST(RIGHT(KeyValue,2) AS INT) FROM HotelSetup
where SearchKey = 'RoomNumberPlanColumns'

IF @LastValue < 22
BEGIN
	Update HotelSetup
	Set KeyValue = REPLACE(KeyValue,'21','27')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'20','26')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'19','25')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'18','24')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'17','23')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'16','22')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'15','21')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'14','20')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'13','15')
	where SearchKey = 'RoomNumberPlanColumns'


	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'12','14')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'11','13')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,'10','12')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,',9',',11')
	where SearchKey = 'RoomNumberPlanColumns'

	Update HotelSetup
	SET KeyValue = REPLACE(KeyValue,',8',',9')
	where SearchKey = 'RoomNumberPlanColumns'
END
