title: How to Access Cursor Columns Without FETCH .. INTO
body: <p>I'm using SQL Server to build stored procedures, and I'm using cursors to loop through a select statement</p>
  
  <p>I'm defining the cursor as follow:</p>
  
  <pre><code>DECLARE @c_col1 varchar(max);
  DECLARE @c_col2 varchar(max);
  
  DECLARE c as CURSOR FOR 
  SELECT col1, col2 
  FROM table;
  
  OPEN c;
  FETCH NEXT FROM c INTO
  @c_col1, @c_col2;
  
  SELECT @c_col1, @c_col2;
  </code></pre>
  
  <p>Is there a way to access the columns of the cursor without a need to declare variables for each column and to use INTO in FETCH clause? In other words, is it possible to use:</p>
  
  <pre><code>DECLARE c as CURSOR FOR 
  SELECT col1, col2 
  FROM table;
  
  OPEN c;
  FETCH NEXT FROM c; 
  
  SELECT c.col1, c.col2;
  </code></pre>