title: assigning return values in sp
body: <p>I have the code : </p>
  
  <pre><code>ALTER PROC sp_get_location 
  (
      @partNumber VARCHAR (100),
      @tempVar VARCHAR (100) OUTPUT
  )
  AS
  BEGIN
      SET @tempVar = STUFF((SELECT (', ' + location + ' (' + CAST(quantity AS VARCHAR (100)) + ')') FROM dbo.warehouse where part_number LIKE @partNumber FOR XML PATH ('')), 1, 1, '')
  END
  </code></pre>
  
  <p>And I call it like this : </p>
  
  <pre><code>    DECLARE @tempVar varchar (100)
      EXEC dbo.sp_get_location @partNUmber = 'pn3', @tempVar
      SELECT @tempVar
  </code></pre>
  
  <p>But I keep getting an error like this : </p>
  
  <blockquote>
    <p>Msg 119, Level 15, State 1, Line 3 Must pass parameter number 2 and
    subsequent parameters as '@name = value'. After the form '@name =
    value' has been used, all subsequent parameters must be passed in the
    form '@name = value'.</p>
  </blockquote>
  
  <p>I've already searched and tried lots of things posted in the internet but I just can't make the code run. What am I doing wrong?</p>
  
  <p>I am running this in <strong>sql server 2005</strong> anyway</p>