title: Retrieve a row from a cursor in SQL Server
body: <p>This should be simple, I can't find a way to do it :</p>
  
  <p>I want to loop through all the rows of a table using a cursor and I need ALL the columns of the row :</p>
  
  <pre><code>DECLARE cursor1 CURSOR FOR
      SELECT *
      FROM Table_1 order by l1;
  
  DECLARE rr ROW for cursor1;     /*does not work */
  
  OPEN cursor1;
  FETCH NEXT FROM cursor1 into rr;    /*does not work */
  
  WHILE @@FETCH_STATUS = 0
  BEGIN
      INSERT INTO Centres 
      VALUES(rr.l1, rr.l2, rr.l3)    /*does not work because of rr */
  
      FETCH NEXT FROM cursor1 into rr;    /*does not work */
  END;
  
  CLOSE cursor1;
  DEALLOCATE cursor1;
  GO
  </code></pre>
  
  <p>Unfortunately, I cannot declare a variable that is row type of my cursor... or can I ?</p>