WHEN ips.avg_fragmentation_in_percent > 30 THEN 'REBUILD' WHEN ips.avg_fragmentation_in_percent > 10 THEN 'REORGANIZE' ...
@BADIndex BIT = 1, -- Set to 1 to include analysis of bad non-clustered indexes @MissingIndex BIT = 1, -- Set to 1 to include analysis of missing indexes ...