CREATE FUNCTION DBO.[GetTurnoverToBonusPointRatio] () RETURNS MONEY AS  
BEGIN 
  DECLARE @Res MONEY

  SELECT @Res = CONVERT(money, IsNull(KeyValue, '1')) FROM HotelSetup WITH (NOLOCK) WHERE SearchKey = 'BonusPointRatio'
  IF @@RowCount = 0
    SET @Res = 1

  RETURN @Res
END