Recursive query with SQL Server’s Common Table Expressions