WITH tree AS ( SELECT ID, Name, ParentID, CAST(\'0\' AS VARCHAR(MAX)) as Parent FROM family -- Initialize the ParentID to 290 WHERE ParentID = 29