Skip to content

Commit 68fc638

Browse files
authored
Update IndexOptimize.sql
Changed order of insert to move NORECOMPUTE before the RESAMPLE.
1 parent af934ef commit 68fc638

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)