Hi all, I have hit a problem in SQL server 2016 and I don't have access to 2017 to see if the same problem occurs there to. If someone would be so kind as to try the below query in a SQL 2017 environment and report back here I would be very grateful.
In SQL 2016 (SP2-CU3) (KB4458871) - 13.0.5216.0 (X64), Std. Ed., the query results in an error message:
Msg 8624, Level 16, State 17, Line 16
Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.
With it a stackdump is created and logged in the sql log. So better not run it in a production environment...
The query has no table requirements and no side effects, so it can be run in any database. This is a very simplified version of an extremely complex query. The crucial part seems to be to generate an xml type in an outer apply, which then gets processed by the .nodes() function.
Here's the query I would like to hear your results for:
select top 1
from t2.xmlfragment.nodes('/*') n(e)
) t1 (v)
outer apply (
t.val as [@val]
select 1 as [val]
for xml path('el'), type
) t2 (xmlfragment)
- This topic was modified 1 year, 3 months ago by R.P.Rozema. Reason: removed order by as it is not needed to reproduce the problem
- This topic was modified 1 year, 3 months ago by R.P.Rozema. Reason: Also union all can be left out and still the dump occurs
Posting Data Etiquette - Jeff Moden[/url]
Posting Performance Based Questions - Gail Shaw[/url]
Hidden RBAR - Jeff Moden[/url]
Cross Tabs and Pivots - Jeff Moden[/url]
Catch-all queries - Gail Shaw[/url]
If you don't have time to do it right, when will you have time to do it over?