title: Returning while-loop values as multiple rows in SQL Server instead of multiple result sets
body: <p>I have the following T-SQL, used to generate some random values:</p>
  
  <pre><code>DECLARE @cnt INT = 0;
  
  WHILE @cnt &lt; 100
  BEGIN
  
  select
      Random_String =
      substring(x,(abs(checksum(newid()))%36)+1,1)+       
      substring(x,(abs(checksum(newid()))%36)+1,1)+
      substring(x,(abs(checksum(newid()))%36)+1,1)
  
  from
            (select x='0123456789ABCDEFGHJKLMNPQRSTUWXYZ%#-=+') a
  
            SET @cnt = @cnt + 1;
  END;
  </code></pre>
  
  <p>This works well enough, except every string is returned as, what looks like, an independent result set.  </p>
  
  <p>Is there a way to refactor that query to return every value as one row in the same result set?</p>
  
  <p>Environment is MS SQL Server 2008.</p>
  
  <p>Thanks!</p>