olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

PartitionLevel check missing #748

Open hanudeep opened 1 year ago

hanudeep commented 1 year ago

Description of the issue

SQL Server version and edition for all Versions

Version of the script all version till 2022

What command are you executing? exec IndexOptimize @database = 'User_Databases', @PartitionLevel = 'N', @LogTable = 'Y' - is throwing error @Line number 1586 > index_resumable_operations.partition_number = partitions.partition_number

"Multi-part Identifier "partitions.partition_number " could not be bound

Fix ? Please add CASE WHEN @ParitionLevel = 'Y' then ' index_resumable_operations.partition_number = partitions.partition_number '