Isn't there a memory threshhold when defining a SQL Server Query using Common Table Expressions?

I have a SQL Server Query that is defining and utilizing and deriving some 25 CTE Tables because I have to derive various sub-totals based on my "Alpha" Table and the data contents within it.

My Query worked up to a point and then all of a sudden it was throwing a weird error when attempting to join to one of my previously defined CTEs and I know for a fact that the CTE Table name and derived CTE column name were correct. Yet my query was giving me an undefined message.

I kind of remember that I hit a memory threshold in a previous SQL Server Query in which I was using multiple CTEs.Is there a memory threshold, ceiling, when defining a SQL Server Query utilizing multiple Common Table Expressions?

I guess I have no choice but to go back and re-engineer this query using #Temp Tables.

I welcome your feedback and Thanks in advance for your help.

June 22nd, 2015 9:33pm

I kind of remember that I hit a memory threshold in a previous SQL Server Query in which I was using multiple CTEs.

A CTE = "Common Table Expression" is just a different way to write query, SQL Server resolve it into one query; so there is not "memory threshold" for CTE usage.

Which exact error message are you getting?

Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2015 3:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics