SELECT OBJECT_NAME(s.object_id) AS Table_Name, avg_page_space_used_in_percent, avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, 'DETAILED') s
WHERE OBJECT_NAME(s.object_id) = 'ISOL1471' AND
(
(avg_page_space_used_in_percent > 60) OR
(avg_fragmentation_in_percent < 15)
)
ALTER INDEX ALL ON Practice.ISOL1471 REBUILD WITH (FILLFACTOR=90, ONLINE=ON);
SELECT OBJECT_NAME(s.object_id) AS Table_Name, avg_page_space_used_in_percent, avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, 'DETAILED') s
WHERE OBJECT_NAME(s.object_id) = 'ISOL1471' AND
(
(avg_page_space_used_in_percent > 60) OR
(avg_fragmentation_in_percent < 15)
)
|