SELECT t.name AS [Table], i.name AS [Index], ddips.avg_fragmentation_in_percent AS [Fragmentation], ddips.page_count AS [Page Count]
,(SELECT TOP 1 rowcnt FROM sysindexes si WHERE si.id = i.object_id) AS [Row Count], STATS_DATE(i.object_id, i.index_id) AS [Statistics Date]
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS ddips
INNER JOIN sys.tables t ON t.object_id = ddips.object_id
INNER JOIN sys.indexes i ON i.object_id = ddips.object_id AND ddips.index_id = i.index_id
WHERE ddips.database_id = DB_ID() AND i.name IS NOT NULL --AND ddips.avg_fragmentation_in_percent > 0
--AND t.name IN ('')
ORDER BY ddips.avg_fragmentation_in_percent DESC