olahallengren / sql-server-maintenance-solution

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

Using @PartitionLevel = 'N' results in error: Line 68 The multi-part identifier "partitions.partition_number" could not be bound. #684

Open danrcarollo opened 2 years ago

danrcarollo commented 2 years ago

Description of the issue I tried to run update stats using this command with @PartionLevel='N'

I get this error:

Msg 4104, Level 16, State 1, Line 71
The multi-part identifier "partitions.partition_number" could not be bound.

SQL Server version and edition Microsoft SQL Server 2019 (RTM-CU16-GDR) (KB5014353) - 15.0.4236.7

Version of the script Version: 2022-01-02 13:58:13

What command are you executing?

   EXECUTE maint.dbo.IndexOptimize
        @Databases = 'DBName',
        @FragmentationLow = NULL,
        @FragmentationMedium = NULL,
        @FragmentationHigh = NULL,
        @UpdateStatistics = 'INDEX',
        @StatisticsModificationLevel=1,
        @PartitionLevel = 'N',
        @LogToTable='Y',
        @MaxDop=2

What output are you getting?


Version: 15.0.4236.7
Edition: Enterprise Edition: Core-based Licensing (64-bit)
Platform: Windows
Procedure: [Maint].[dbo].[IndexOptimize]
Parameters: @Databases = 'MyDB', @FragmentationLow = NULL, @FragmentationMedium = NULL, @FragmentationHigh = NULL, @FragmentationLevel1 = 5, @FragmentationLevel2 = 30, @MinNumberOfPages = 1000, @MaxNumberOfPages = NULL, @SortInTempdb = 'N', @MaxDOP = 2, @FillFactor = NULL, @PadIndex = NULL, @LOBCompaction = 'Y', @UpdateStatistics = 'INDEX', @OnlyModifiedStatistics = 'N', @StatisticsModificationLevel = 1, @StatisticsSample = NULL, @StatisticsResample = 'N', @PartitionLevel = 'N', @MSShippedObjects = 'N', @Indexes = NULL, @TimeLimit = NULL, @Delay = NULL, @WaitAtLowPriorityMaxDuration = NULL, @WaitAtLowPriorityAbortAfterWait = NULL, @Resumable = 'N', @AvailabilityGroups = NULL, @LockTimeout = NULL, @LockMessageSeverity = 16, @StringDelimiter = ',', @DatabaseOrder = NULL, @DatabasesInParallel = 'N', @ExecuteAsUser = NULL, @LogToTable = 'Y', @Execute = 'Y'
Version: 2022-01-02 13:58:13
Source: https://ola.hallengren.com

Date and time: 2022-09-15 12:43:16
Database: [MyDB]
State: ONLINE
Standby: No
Updateability: READ_WRITE
User access: MULTI_USER
Recovery model: SIMPLE
Is accessible: Yes

Msg 4104, Level 16, State 1, Line 71
The multi-part identifier "partitions.partition_number" could not be bound.
Date and time: 2022-09-15 12:43:16
ze1441 commented 1 year ago

Hello,

check this issue for the solution: https://github.com/olahallengren/sql-server-maintenance-solution/issues/738