title: Return result of select query only if not empty
body: <p>Working with Sql Server. Writing a stored procedure. Here is the pseudocode for what I want to achieve:</p>
  
  <pre><code>    IF EXISTS ( SELECT  field1
                  FROM    t1
                  WHERE   field1 = ... AND field2 = ...) 
          BEGIN
              SELECT  field1
                  FROM    t1
                  WHERE   field1 = ... AND field2 = ...
          END
  </code></pre>
  
  <p>any better way of doing this? Any help appreciated.</p>
  
  <p>Chirayu</p>
  
  <p>Update: The problem is that the same query is executed twice. I cannot also just the run query once and return null (if the result is null i would like to return an alternative result).</p>