AzureSQL icon indicating copy to clipboard operation
AzureSQL copied to clipboard

Prevent error when current SQL Server version does not support RESUMABLE

Open mperdeck opened this issue 9 months ago • 0 comments

I want to use your script AzureSQLMaintenance with a version of SQL Server that does not support RESUMABLE.

The script does check for that situation. However, when RESUMABLE is not supported, or parameter @ResumableIndexRebuild = 0, the script adds "RESUMABLE=OFF" to the "ALTER INDEX REBUILD" command.

This causes an error, because my older version of SQL Server doesn't recognize RESUMABLE at all, including "RESUMABLE=OFF"

This pull request changes the code, so when RESUMABLE is not supported, or parameter @ResumableIndexRebuild = 0, it doesn't add "RESUMABLE=OFF". "OFF" is the default anyway for RESUMABLE, so this doesn't change existing behavior when the script runs.

When RESUMABLE is supported, and parameter @ResumableIndexRebuild = 1, it still adds "RESUMABLE=ON"

mperdeck avatar May 08 '24 06:05 mperdeck