title: Stored procedure with output parameters vs. table-valued function?
body: <p>Which approach is better to use if I need a <em>member</em> (sp or func) returning 2 parameters:</p>
  
  <pre><code>CREATE PROCEDURE Test
     @in INT,
     @outID INT OUT,
     @amount DECIMAL OUT
  AS
  BEGIN
     ...
  END
  </code></pre>
  
  <p>or</p>
  
  <pre><code>CREATE FUNCTION Test
  (
     @in INT
  )
  RETURNS @ret TABLE (outID INT, amount DECIMAL)
  AS
  BEGIN
     ...
  END
  </code></pre>
  
  <p>What are pros and cons of each approach considering that the result will passed to another stored procedure:</p>
  
  <pre><code>EXEC Foobar @outID, @outAmount
  </code></pre>