title: SQL - Iterating through table records
body: <p>I have created user-defined function that converts a comma-delimited string into a table. I execute this function like so:</p>
  
  <pre><code>select [String] as 'ID' from dbo.ConvertStringToTable('1,2,3,4')
  </code></pre>
  
  <p>The results from this query look like the following:</p>
  
  <pre><code>ID
  --
  1
  2
  3
  4
  </code></pre>
  
  <p>In reality, I want to iterate through each of the rows in this table. However, I cannot figure out how to do this. Can someone show me some sample SQL of how to iterate through the rows of the table?</p>