How many maximum recursions are possible for CTEs on an SQL server?

How much maximum recursion level is possible for CTE on SQL server? If the maximum level of recursion is reached, what is the alternative way?

+3
source share
1 answer

By default it is 100.

You can change it for each request by adding a hint:

OPTION (MAXRECURSION N)

until the end of the request.

OPTION (MAXRECURSION 0)

means no explicit restriction.

When the recursion limit is reached, an error occurs and the request aborts.

+8
source

Source: https://habr.com/ru/post/1741251/


All Articles