materialized

T-SQL CTE materializing techniques not working on SQL Server 2012

我的未来我决定 提交于 2019-11-27 02:25:32
问题 I have to use the following techniques to materialized my CTEs and increase the view performance: WITH CTE AS( SELECT TOP 100 PERCENT ORDER BY ... ) WITH CTE AS( SELECT TOP 2147483647 ORDER BY ... ) Now, neither of this ways works. Has anyone face the same issue or know if in SQL Server 2012 this things are not valid? 回答1: You could try using a multi-step table valued function. This way, the server is forced to materialize the TVF's results into a table variable. Also, you could try using