CREATE FUNCTION dbo.IsHotelInHotelList(@AhotelNumber int, @AHotelNumberList VARCHAR(500))
RETURNS BIT
AS
BEGIN
  DECLARE @Return BIT

  SET @Return = 0
  SET @AHotelNumberList = ','  +@AHotelNumberList + ','

   IF CHARINDEX (',' + CONVERT(VARCHAR (3),@AHotelNumber) + ',', @AHotelNumberList) > 0
     SET @Return = 1
  RETURN @Return
 END

