title: SQL Server Cursor data as result of stored procedure
body: <p>I have a stored procedure</p>
  
  <pre><code>DECLARE cursor FOR SELECT [FooData] From [FooTable];
  OPEN cursor ;  
  FETCH NEXT FROM cursor INTO @CurrFooData;
  WHILE @@FETCH_STATUS = 0
  BEGIN
    SELECT @CurrFooData AS FooData;
    INSERT INTO Bar (BarData) VALUES(@CurrFooData);
    FETCH NEXT FROM cursor INTO @CurrFooData;
  END;
  CLOSE cursor 
  DEALLOCATE cursor 
  </code></pre>
  
  <p>But in result I have a lot of tables, not one. How can I return one table with 'FooData' column and all '@CurrFooData' rows?</p>