title: concatenate string inside sql recursive WITH statement CTE
body: <p>i'm trying to concatenate the values from a column from all levels of a certain path</p>
  
  <p>this is my sql:</p>
  
  <pre><code>WITH
  hi as (
  select c.id id, cast(c.code as nvarchar) code, c.title, c.parent from CaseTypes c 
  where c.parent is null
  
  union all
  
  select c.id, cast((h.code + c.code ) as nvarchar) code , c.title, c.parent from CaseTypes c 
  inner join hi h on c.parent = h.id
  )
  select * from hi
  </code></pre>
  
  <p>the problem is that only the first level (where parent is null) is taken, the rest isn't</p>