title: Counting specific values across columns within SQL Server 2008 view
body: <p>I have the following data:</p>
  
  <hr>
  
  <pre><code>   ID Column1 Column2 Column3 Column4 Column5
     001   A        C       D        A      B
     002   A        D       A        B      A
     003   B        K       Q        C      Q
     004   A        K       E        E      B
  </code></pre>
  
  <hr>
  
  <p>I want to create a new column in a view which gives me the count of "A"s across the 5 source columns for each row.  The result should look  like this:</p>
  
  <pre><code>    ID Column1 Column2 Column3 Column4 Column5  SumOfA
      001   A        C       D        A      B       2
      002   A        D       A        B      A       3
      003   B        K       Q        C      Q       0
      004   A        K       E        E      B       1
  </code></pre>
  
  <hr>
  
  <p>I've seen several examples here but they return instances of "A" across records - I want the count of "A"s across the columns, not aggregating across rows.  Any thoughts? </p>