title: CTE error: "Types don't match between the anchor and the recursive part"
body: <p>I am executing the following statement:</p>
  
  <pre><code>;WITH cte AS (
    SELECT 
      1 as rn, 
      'name1' as nm
    UNION ALL
    SELECT 
      rn + 1,
      nm = 'name' + CAST((rn + 1) as varchar(255))
    FROM cte a WHERE rn &lt; 10)
  SELECT * 
  FROM cte
  </code></pre>
  
  <p>...which finishes with the error...</p>
  
  <pre><code>Msg 240, Level 16, State 1, Line 2
  Types don't match between the anchor and the recursive part in column "nm" of recursive query "cte".
  </code></pre>
  
  <p>Where am I making the mistake?</p>