olahallengren / sql-server-maintenance-solution

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

IndexOptimize.sql error as non optional use tables for PartitionLevel #476

Open DreamThemeGH opened 3 years ago

DreamThemeGH commented 3 years ago

Description of the issue Error "The multi-part identifier "partitions.partition_number" could not be bound.". I think, that the join by partition should be optional for @PartitionLevel = 'Y' IndexOptimize

SQL Server version and edition Microsoft SQL Server 2017

Version of the script Version: 2020-12-31 18:58:56

What command are you executing? EXECUTE service.IndexOptimize @Databases = 'MyBase', @FragmentationLow = NULL, @FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE', @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @Indexes = 'ALL_INDEXES',--, -AdventureWorks.Production.Product' @UpdateStatistics = 'ALL', @StatisticsSample = 100, --!!! @TimeLimit = 3600, @LogToTable = 'Y';

What output are you getting? Error "The multi-part identifier "partitions.partition_number" could not be bound."

swathireddy711 commented 3 years ago

I am having same error. How was this issue resolved?

deffinity commented 2 years ago

Welp, there should be a logic for for @PartitionLevel = 'Y' but I just disabled the whole string with @ Version >= 99. Resumable index ops are of no use for me anyway.