title: SQL Server - Test the result of a stored procedure
body: <p>In SQL Server, it is possible to test the result of a stored procedure to know if the result return rows or nothing ?</p>
  
  <p>Example : </p>
  
  <pre><code>EXEC _sp_MySp 1, 2, 3
  
  IF @@ROWCOUNT = 0
  BEGIN
      PRINT('Empty')
  END
  ELSE
  BEGIN
      PRINT(@@ROWCOUNT)
  END
  </code></pre>
  
  <p>But @@ROWCOUNT always return 0 so maybe is there another way of doing this ?</p>