Skip to content

Commit f5d1d1b

Browse files
authored
Merge pull request #3 from bwiggins10/master
IndexOptimize Fix NORECOMPUTE before the RESAMPLE issue
2 parents 4611484 + 68fc638 commit f5d1d1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

IndexOptimize.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,16 +2239,16 @@ BEGIN
22392239
SELECT 'SAMPLE ' + CAST(@CurrentStatisticsSample AS nvarchar) + ' PERCENT'
22402240
END
22412241

2242-
IF @CurrentStatisticsResample = 'Y'
2242+
IF @CurrentNoRecompute = 1
22432243
BEGIN
22442244
INSERT INTO @CurrentUpdateStatisticsWithClauseArguments (Argument)
2245-
SELECT 'RESAMPLE'
2245+
SELECT 'NORECOMPUTE'
22462246
END
22472247

2248-
IF @CurrentNoRecompute = 1
2248+
IF @CurrentStatisticsResample = 'Y'
22492249
BEGIN
22502250
INSERT INTO @CurrentUpdateStatisticsWithClauseArguments (Argument)
2251-
SELECT 'NORECOMPUTE'
2251+
SELECT 'RESAMPLE'
22522252
END
22532253

22542254
IF EXISTS (SELECT * FROM @CurrentUpdateStatisticsWithClauseArguments)

0 commit comments

Comments
 (0)