Just Code‎ > ‎

TSQL - Rebuild all indexes that does not have fillfactor = X

posted Apr 9, 2013, 7:06 AM by Peter Henell   [ updated Apr 9, 2013, 7:06 AM ]

SELECT 'ALTER INDEX ['+i.name+'] ON ['+SCHEMA_NAME(o.schema_id)+'].['+o.name+']  REBUILD PARTITION = ALL WITH (FILLFACTOR = 90)' 
FROM sys.indexes i
INNER JOIN sys.objects o
ON i.object_id = o.object_id
WHERE fill_factor <> 90
Comments