Recursion in SQL Server using Common Table Expressions (CTE) https://www.danylkoweb.com/Blog/recursion-in-sql-server-using-common-table-express