Hi,
I have a scenario where I need to "generate" fact data, so I'm using a CTE to generate the data. For maintainability reasons I have this CTE declared inside a view and in the DSV Named Query I just have a SELECT * FROM FactView.
This works fine as long as the recursion level falls within the default limit of 100. If it does not, I have to specify the maximum recursion level such as:
SELECT *
FROM FactView
OPTION (MAXRECURSION 0)
The problem is I can't specify the Named Query like this. As explained elsewhere my query is embeded as a subquery and the OPTION keyword cannot be used in a subquery.
Is there any other way I can specify the maximum recursion level on a Named Query?