olahallengren / sql-server-maintenance-solution

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

Exclude Multiple tables #790

Open d-moloney opened 10 months ago

d-moloney commented 10 months ago

Description of the issue i am trying to run IndexOptimize and exclude multiple tables. Its only skipping the first one.

SQL Server version and edition Microsoft SQL Server 2019 (RTM-CU21) (KB5025808) - 15.0.4316.3 (X64) Jun 1 2023 16:32:31 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)

Version of the script Version: 2022-12-03 17:23:44

What command are you executing? I do have a dash in front of each table exec [dbo].[IndexOptimize] @Databases='databasename', @LogToTable='Y', @Indexes = 'ALL_INDEXES, -databasename.dbo.table1,-databasename.dbo.table2' and I tried a dash in front of the first table exec [dbo].[IndexOptimize] @Databases='databasename', @LogToTable='Y', @Indexes = 'ALL_INDEXES, -databasename.dbo.table1,databasename.dbo.table2'

What output are you getting?

its is not skippng the second table.