Forum Discussion
bboissard
Oct 29, 2024Copper Contributor
SQL Server failing to execute extremely complex queries
A query is failing with this error message on a customer environment: The query processor ran out of internal resources and could not produce a query plan.
This is a rare event and only expected fo...
Mike_Lemay
Nov 12, 2024Copper Contributor
If you can't fix this with hardware you will have to consider fixing the query.
If it's a lot of unions maybe you could break the query into sections copying 10 (or so) unioned tables into temp tables, then union the staged tables in a final result set.