SELECTOBJECT_NAME(object_id) AS tblName,(SELECT name FROM sys.indexes WHERE object_id = a.object_id and index_id = a.index_id),avg_fragmentation_in_percentFROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, NULL) aWHERE avg_fragmentation_in_percent > 30AND index_type_desc IN('CLUSTERED INDEX', 'NONCLUSTERED INDEX')ORDER BY avg_fragmentation_in_percent DESC
Ads 720 x 90
Related Posts
Total Pageviews
Label List
- Architecture
- Art of SQL Server
- asynchronous mirroring
- csv
- dmv
- find outdated Statistics
- Free SQL Server tools
- index fragmentation
- Installation
- Katmai
- Learn SQL Server 2005
- Maintenance Plan
- outdated Statistics
- Reset Identity column
- Scripts
- SPID
- sql server 2008
- sys.dm_db_index_physical_stats
- sys.dm_exec_connections
- tsql
- update statistics