This is extremely good code. I liked it. I found a small bug in your code

When you compare t2.Employee_Id_Path not like '%' + cast(t1.Employee_Id as varchar(10)) + '\%', it was comparing "2" with...