title: How to Short-Circuit SQL Where Clause
body: <p>I am trying to perform the following query in SQL server:</p>
  <pre><code>declare @queryWord as nvarchar(20) = 'asdas'
  
  SELECT  * FROM TABLE_1 
  WHERE (ISDATE(@queryWord) = 1) 
  AND TABLE_1.INIT_DATE = CONVERT(Date, @queryWord)
  </code></pre>
  <p>This obviously causes an error because <code>'asdas'</code> cannot be converted to <code>Date</code>. Although, I was expecting a different behavior. That is, because <code>ISDATE(@queryWord) = 1</code> is <code>false</code>, I was expecting SQL to <strong>not</strong> check the second condition, but apparently, it does.</p>
  <p>I know there are some other ways to perform this query but this is not my question. I wonder if there is some way to do not check the second condition is the first one does not satisfy. I am curious because I thought that SQL already did this.</p>