title: Stored Procedure, when to use Output parameter vs Return variable
body: <p>When would you use an output parameter vs a return variable, or vice versa? In the following simple example, I can achieve the same thing using either one.</p>
  
  <p>Using output parameter</p>
  
  <pre><code>create proc dbo.TestOutput (@InValue int, @OutValue int output)
  as
  set @OutValue = @InValue
  
  declare @x int
  exec TestOutput @InValue = 3, @OutValue = @x output
  select @x 
  </code></pre>
  
  <p>Using return variable:</p>
  
  <pre><code>create proc dbo.TestReturn (@InValue int)
  as
  return @InValue
  
  declare @x int
  exec @x = TestReturn @InValue = 3
  select @x 
  </code></pre>
  
  <p>As you can see, they both do the same thing. Can someone show me an example where the choice of a output parameter vs a return variable would make a difference?</p>