title: Select and EXEC in a single statement - SQL server
body: <p>I have a temp table in a SP. I insert some values into it. I will need to then EXEC  a second SP by sending in the values from the temp table. I would rather avoid having to use local variables.</p>
  
  <pre><code>DECLARE @tmp TABLE
  (
    Name VARCHAR(200).
    Code INT
  )
  
  INSERT INTO @tmp
  SELECT 'TEST', 100
  
  EXEC MyProc
    @Name = --Here I send the values from temp
    @Code =
  </code></pre>