SQL Server -DMV to View Index Fragmentation

--DMV to View Index fragmentation

 

SELECT​​ 

OBJECT_SCHEMA_NAME(i.object_id),

OBJECT_NAME(i.object_id),

*​​ 

FROM​​ 

sys.dm_db_index_physical_stats(NULL,NULL,NULL,NULL,NULL)​​ ips

JOIN

sys.indexes​​ i​​ ON​​ ips.OBJECT_ID​​ =​​ i.OBJECT_ID​​ AND​​ ips.index_id​​ =​​ i.index_id

 

Knowledge worth sharing...Share on linkedin
Linkedin
Share on facebook
Facebook
Share on google
Google
Share on twitter
Twitter
Bookmark the permalink.

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *