The sys.indexes view not only displays indexes, but also tables that have no indexes. Such tables are called heaps. In this case, the index name is missing. I agree, this can be misleading.
SELECT i.object_id, i.type_desc, i.name AS IndexName, s.used_page_count * 8 AS IndexSizeKB FROM sys.dm_db_partition_stats AS s JOIN sys.indexes AS i ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id WHERE s.[object_id] = object_id('dbo.Stu') ORDER BY i.object_id, i.name
Basically, if the query you send returns a NULL index, this means that your dbo.Stu table does not have a clustered index.
I would recommend creating a clustered index in a table.
source share