title: Iterate through a temp table
body: <p>I did try looping through a temp table, but of no use end up with so many errors only.</p>
  
  <p>Please help me on how can I work this one out..</p>
  
  <p>My need is like :</p>
  
  <hr>
  
  <ul>
  <li>I need to fetch an ID column from a table, and store it in one temp table.</li>
  <li>Then iterate through each ID, and execute a stored procedure which takes that ID as an parameter.</li>
  <li>Insert the return value (= one column) of that stored procedure in another table.</li>
  </ul>
  
  <p>Please guide me on how to do this.</p>
  
  <p>I did search a lot..and got confused with cursor and set based join.</p>