title: Execution of ISNULL in SQL Server
body: <p>Here is how i am using ISNULL condition to check for student address.
  It works fine but how ISNULL function treat the null codition i.e the second parameter which is display if first condition is null.</p>
  
  <p><strong>Will it calculate Value for second parameter when first condition is not null?</strong></p>
  
  <pre><code>select 
     ...
     ...
     (CASE 
        WHEN st.ADDRESS='Y' THEN st.LOCATION
          ELSE 
            ISNULL(
                   (SELECT TOP 1 STDLOC.LOCATION FROM STDLOC 
                    INNER JOIN COMLOC ON STKLOC.LOCATION=COMLOC.CODE  AND COMLOC.ADDRESS='Y' 
                    WHERE STDLOC.ZIBCODE=st.ZIBCODE)
                  ,(SELECT TOP 1 COMLOC.LOCATION  FROM COMLOC COMLOC.ZIBCODE=st.ZIBCODE))                       
         END
          ) AS STDUDENTLOCATION
     FROM STUDENT st
  </code></pre>