code: def __buildLimit(self, query ,limitResMax):
          
          limit = query._getParameters()['limit']
          if limitResMax>0 and limitResMax < limit:
              query = UpdateParameter(query, 'limit', limitResMax)
              query = UpdateParameter(query, 'nocount', 'true')        
          elif  limitResMax>0 and  limitResMax >= limit:
              query = UpdateParameter(query, 'nocount', 'true')
          return query
docs: Builds limit parameter.