title: can i iterate through a table in sql without having an id column?
body: <p>Let's say I have a table with two columns (e.g. quarter and year) and I want to create a third column based on the value of these two. Is there a way to iterate the table with a while loop without having or creating an identity column?</p>
  
  <p>Well to give you an example, let's say I have these rows:</p>
  
  <pre><code>Quarter    Year    Datetimes  
  ---------- ------  --------------  
  1          2018    null  
  2          2018    null  
  3          2018    null  
  </code></pre>
  
  <p>I want to update the 3rd column and make it:</p>
  
  <pre><code>Quarter    Year    Datetimes  
  ---------- ------  --------------  
  1          2018    2018-03-31 00:00:00.000  
  2          2018    2018-06-30 00:00:00.000  
  3          2018    2018-09-30 00:00:00.000  
  </code></pre>
  
  <p>I know how to make the conversion, the formula is this:   </p>
  
  <pre><code>DATEADD(YEAR, @theYear - 1900, DATEADD(QQ, @TheQuarter, -1)).   
  </code></pre>
  
  <p>The problem is that I want to update the table, which means I want to add new information, not just show what the 3rd column would be as an output.</p>