title: What is the easiest way to find a sql query returns a result or not?
body: <p>Consider the following sql server query ,</p>
  
  <pre><code> DECLARE @Table TABLE(
          Wages FLOAT
  )
  
  INSERT INTO @Table SELECT 20000 
  INSERT INTO @Table SELECT 15000 
  INSERT INTO @Table SELECT 10000
  INSERT INTO @Table SELECT 45000
  INSERT INTO @Table SELECT 50000
  
  SELECT  *
  FROM    (
              SELECT  *,
                      ROW_NUMBER() OVER(ORDER BY Wages DESC) RowID
              FROM    @Table 
          ) sub
  WHERE   RowID = 3
  </code></pre>
  
  <p>The result of the query would be <code>20000</code> ..... Thats fine as of now i have to find the result of this query,</p>
  
  <pre><code>SELECT  *
  FROM    (
              SELECT  *,
                      ROW_NUMBER() OVER(ORDER BY Wages DESC) RowID
              FROM    @Table 
          ) sub
  WHERE   RowID = 6
  </code></pre>
  
  <p>It will not give any result because there are only <code>5</code> rows in the table.....
  so now my question is </p>
  
  <p>What is the easiest way to find a sql query returns a result or not?</p>