DECLARE @db_id SMALLINT;
DECLARE @object_id INT;
SET @db_id = DB_ID(N'dbName');
SET @object_id = OBJECT_ID(N'tableName');
IF @object_id IS NULL
BEGIN;
PRINT N'Invalid object';
END;
ELSE
BEGIN;
SELECT * FROM sys.dm_db_index_physical_stats(@db_id, @object_id, 11, NULL , 'LIMITED');
END;
GO
database_idobject_idindex_idpartition_numberindex_type_descalloc_unit_type_descindex_depthindex_levelavg_fragmentation_in_percentfragment_countavg_fragment_size_in_pagespage_countavg_page_space_used_in_percent
51963870063111NONCLUSTERED INDEXIN_ROW_DATA4094.01368771129372062721.05830165994415218298NULL
edit: heres a link ot the screenshot, thats impossible to read
thanks! 🙂