title: Selecting X Number of rows or lower if X number of rows not available
body: <p>I am trying to select and inset X rows into a temp table at each execution, I have numbered the rows. However, I tried using PERCENT and TOP but not getting the desire results.</p>
  
  <p>Note: I am not trying to get specific number of rows <strong>between certain numbers</strong>. I just need to get a fix number, and if the number of available rows is below the select request, then get less but do not exceed.</p>
  
  <p>I assigned the row numbers like this:</p>
  
  <pre><code>WITH GetRecordByIncrement AS
  (
  SELECT 
       [RowNumber] = ROW_NUMBER() OVER (ORDER BY UserID ASC)
      ,[Column1]
      ,[Column2]
      ,[Column3]
       FROM MySchema.MyTable
  )
  </code></pre>
  
  <p>How would I get, example: 100 or less rows? This does not work using the row number.</p>