title: T-SQL "dense_rank" with a maximum number of rows with each rank
body: <p>If I do a</p>
  
  <pre><code>dense_rank() over (order by colname),
  </code></pre>
  
  <p>I get the same rank for all rows with the same value in the column colname.</p>
  
  <p>However, I want to limit the number of rows with the same rank to @maxrows so that when @maxrows rows have the same value in colname, a new rank is assigned to the next row even if the value of colname is still the same.</p>
  
  <p>How can I achieve this?</p>