How do you use multiple CTE in one SELECT statement? Two simple examples: independent CTEs joined together, and a second CTE built on the first.
SQL SERVER – SQL SERVER – Simple Example of Recursive CTE – Part 2 – MAXRECURSION – Prevent CTE Infinite Loop
Can you stop a recursive CTE from running forever? Yes. Use the MAXRECURSION option to limit it, and see what happens when the limit is too low.
SQL SERVER – Simple Example of Recursive CTE
A simple example of Recursive CTE in SQL Server, using AdventureWorks to walk the hierarchy of managers and employees, with each part explained.
SQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL – Part 2 – CTE
Part 2 of retrieving TOP and BOTTOM rows together: a reader’s solution using a CTE, the temporary result set introduced in SQL Server 2005.




