Skip to content

Commit 763f5a9

Browse files
committed
Add Craig Freeman blog post for Recursive CTEs
1 parent bca0698 commit 763f5a9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

docs/t-sql/queries/recursive-common-table-expression-transact-sql.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ A recursive CTE consists of three elements:
5353
The termination check is implicit; recursion stops when no rows are returned from the previous invocation.
5454

5555
> [!NOTE]
56-
> An incorrectly composed recursive CTE might cause an infinite loop. For example, if the recursive member query definition returns the same values for both the parent and child columns, an infinite loop is created. When testing the results of a recursive query, you can limit the number of recursion levels allowed for a specific statement by using the `MAXRECURSION` hint and a value between 0 and 32,767 in the `OPTION` clause of the `INSERT`, `UPDATE`, `DELETE`, or `SELECT` statement. For more information, see [Query hints](hints-transact-sql-query.md) and [WITH common_table_expression](with-common-table-expression-transact-sql.md).
56+
> An incorrectly composed recursive CTE might cause an infinite loop. For example, if the recursive member query definition returns the same values for both the parent and child columns, an infinite loop is created. When testing the results of a recursive query, you can limit the number of recursion levels allowed for a specific statement by using the `MAXRECURSION` hint and a value between 0 and 32,767 in the `OPTION` clause of the `INSERT`, `UPDATE`, `DELETE`, or `SELECT` statement.
57+
58+
For more information, see:
59+
60+
- [Query hints](hints-transact-sql-query.md)
61+
- [WITH common_table_expression](with-common-table-expression-transact-sql.md)
62+
- [Recursive CTEs](https://techcommunity.microsoft.com/blog/sqlserver/recursive-ctes/383326)
5763

5864
## Pseudocode and semantics
5965

@@ -231,3 +237,4 @@ NULL 1 Chief Executive Officer 0
231237
- [UPDATE (Transact-SQL)](update-transact-sql.md)
232238
- [DELETE (Transact-SQL)](../statements/delete-transact-sql.md)
233239
- [EXCEPT and INTERSECT (Transact-SQL)](../language-elements/set-operators-except-and-intersect-transact-sql.md)
240+
- [Recursive CTEs](https://techcommunity.microsoft.com/blog/sqlserver/recursive-ctes/383326)

0 commit comments

Comments
 (0)