title: Does SQL Server return true on FIRST fulfillment of a multiple OR Condition in a WHERE clause?
body: <p>I have Table1 with 10 VARCHAR(37) columns and an ID. It has <strong>250 lines</strong>.
  I want to get for a specific <strong>set</strong> of <strong>4 char string</strong> the count of the lines in TABLE1 which have at least one of the 10 columns containing this 4 char string.</p>
  
  <p>The result will look like this</p>
  
  <pre><code>str    count
  ............
  T100     4
  T010    50
    .     .
    .     .
    .     .
  ............
  </code></pre>
  
  <p><strong>My question is not about how to do it, but about the performance</strong></p>
  
  <p>I did it like this</p>
  
  <pre><code>&gt;  DECLARE @Helper TABLE(Str Varchar(4), Count INT DEFAULT 0 )
  &gt;  --I will skip here insering those 150  4char strings into @Helper on Str column
  &gt;  
  &gt;  UPDATE @Helper SET [Count] = SELECT COUNT(ID) FROM Table1 T WHERE
  &gt;     CHARINDEX(Str,T.Col1) &gt; 0 OR CHARINDEX(Str,T.Col2) &gt; 0 ...... OR
  &gt;     CHARINDEX(Str,T.Col10) &gt; 0
  &gt; 
  &gt; --where Col1...Col10 are the VARCHAR(37) columns
  </code></pre>
  
  <p>This takes ~2 seconds. Isn't it too much? My guess is that SQL Server evaluates all the conditions in the WHERE clause, even if only 1 will suffice ( i have only OR).
  Am i right ?
  Or how can I get this done under 2 seconds ?
  I am using SQL server 2008.</p>
  
  <p>Thank you all!</p>