title: How to count most consecutive occurrences of a value in a Column in SQL Server
body: <p>I have a table <code>Attendance</code> in my database.</p>
  
  <pre><code>Date       | Present
  ------------------------
  20/11/2013 |  Y
  21/11/2013 |  Y
  22/11/2013 |  N
  23/11/2013 |  Y
  24/11/2013 |  Y
  25/11/2013 |  Y
  26/11/2013 |  Y
  27/11/2013 |  N
  28/11/2013 |  Y
  </code></pre>
  
  <p>I want to count the most consecutive occurrence of a value <code>Y</code> or <code>N</code>.</p>
  
  <p>For example in the above table <code>Y</code> occurs <strong>2, 4 &amp; 1 times</strong>. So I want <strong>4</strong> as my result.
  How to achieve this in SQL Server?</p>
  
  <p>Any help will be appreciated. </p>