Limitations of Recursive CTEs

There can be more than one anchor member and there can be more than one recursive member.

All anchor members must be positioned before recursive members.

You can link anchor members using the Union All, Union, Intersect, or Except set operators.

The recursive members must be linked using the Union All operator.

A set of anchor members must be linked with a set of recursive members using the Union All operator.

The number and data type of the columns in all query definition members must match.

A recursive member must have one (and only one) reference to its CTE.

Recursive members cannot contain Select Distinct, Group By, Having, scalar aggregations, Top, subqueries, or hints on CTE references.

Only Inner Join is allowed to link tables and CTEs inside a recursive member.

No comments: