Get some fields to create a subquery bringing, details of an object and the indexes it has in SQL SERVER?

1

I'm doing a query in SQL SERVER. I need to know the object, type object, size of the object, indexes that have that object and the percentage of fragmentation of each index.

My doubt lies in the tables to be able to bring the fragmentation of each index and the size of the object.

This is what I have:

 select  distinct so.name,so.type,(so.type_desc),ps.row_count as 
         IdnIsThisIsSize,idx.index_id  from  sys.objects so 
         inner join sys.dm_db_partition_stats ps
         on so.object_id = ps.object_id inner join sys.indexes idx on 
         idx.index_id = ps.index_id;
    
asked by Xpeke 01.12.2018 в 05:25
source

0 answers