From 834f68fad97439bb45d261cfcb7bae26961867b8 Mon Sep 17 00:00:00 2001 From: eschnepel Date: Wed, 13 Sep 2023 09:41:05 +0000 Subject: [PATCH] added return statement to avoid going into OutputResultsToTable block ... otherwise the last result (e.g. spills) would be recorded twice into the output table. --- sp_BlitzCache.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sp_BlitzCache.sql b/sp_BlitzCache.sql index ddd418e2..648b2856 100644 --- a/sp_BlitzCache.sql +++ b/sp_BlitzCache.sql @@ -6955,6 +6955,11 @@ END; EXEC sys.sp_executesql @stmt = @AllSortSql, @params = N'@i_DatabaseName NVARCHAR(128), @i_Top INT, @i_SkipAnalysis BIT, @i_OutputDatabaseName NVARCHAR(258), @i_OutputSchemaName NVARCHAR(258), @i_OutputTableName NVARCHAR(258), @i_CheckDateOverride DATETIMEOFFSET, @i_MinutesBack INT ', @i_DatabaseName = @DatabaseName, @i_Top = @Top, @i_SkipAnalysis = @SkipAnalysis, @i_OutputDatabaseName = @OutputDatabaseName, @i_OutputSchemaName = @OutputSchemaName, @i_OutputTableName = @OutputTableName, @i_CheckDateOverride = @CheckDateOverride, @i_MinutesBack = @MinutesBack; +/* Avoid going into OutputResultsToTable + ... otherwise the last result (e.g. spills) would be recorded twice into the output table. +*/ +RETURN; + /*End of AllSort section*/