Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dewacorp.alliances
452 Posts |
Posted - 2010-07-27 : 23:55:02
|
Hi thereI have the following query and I need to put OPTION (MAXRECURSION 1000) on the CTE section cause that place is where is the problem is (UNION ALL). So I put next to that line and compiled and not working and try different place is not working either (Incorrect syntax near the keyword 'OPTION'.). My question where I should put this into OPTION (MAXRECURSION XXX) ?with tab AS ( select 1 as id, 100 as start, 200 as en union all select 2, 200, 500), cte AS ( select id,start,en from tab union all select id,start+1 , en from cte where start+1<=en )SELECT id,start from cteorder by idNote: If you are taking out union all select 2, 200, 500 from that, it works nicely because it's only up to 100.Any ideas? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|
|