Specify the maxrecursion option at the end of the query:
...
from EmployeeTree
option (maxrecursion 0)
That allows you to specify how often the CTE can recurse before generating an error. Maxrecursion 0 allows infinite recursion.
More Related Contents:
- Paging with Oracle
- Can I pass column name as input parameter in SQL stored Procedure
- SQL Server Insert if not exists
- Pass multiple values in single parameter
- Difference between CTE and SubQuery?
- Update records in table from CTE
- When to use Common Table Expression (CTE)
- Search text in stored procedure in SQL Server
- How do I execute a stored procedure once for each row returned by query?
- Return multiple fields as a record in PostgreSQL with PL/pgSQL
- Multiple CTE in single query
- Dynamic Sorting within SQL Stored Procedures
- Call a stored procedure with another in Oracle
- SQL: Select dynamic column name based on variable
- Which is better: Ad hoc queries or stored procedures? [closed]
- Execute Immediate within a stored procedure keeps giving insufficient priviliges error
- Delete parent if it’s not referenced by any other child
- Procedure or function !!! has too many arguments specified
- Is it possible to have a default parameter for a mysql stored procedure?
- Solution to “cannot perform a DML operation inside a query”?
- Custom Date/Time formatting in SQL Server
- Inserting rows into a table with one IDENTITY column only [duplicate]
- How to get rid of “Error 1329: No data – zero rows fetched, selected, or processed”
- Eliminate and reduce overlapping date ranges
- What is the difference between a stored procedure and a view?
- Functions vs Stored Procedures
- How to execute a stored procedure inside a select query
- Use one CTE many times
- Call stored procedure with table-valued parameter from java
- Insert into from CTE