• In the following line you need to make sure that your index is unique. So you have to check that you are on the right table. Otherwise you can get more indexes returned if they have the same name and index id because the index id is only unique within the table and not within the database. And it is not allowed to get more then one result on that line.

    So when you put in the following then it will work.

    and b.[id]=c.[object_id]

    Select

    (select used/128 from sysindexes b where b.name=c.name and c.index_id = b.indid [font="Arial Black"]and b.[id]=c.[object_id]) [/font]'MB',

    from sys.dm_db_index_usage_stats a

    join sysobjects as o

    on (a.object_id = o.id)

    join sys.indexes as c

    on (a.object_id = c.object_id and a.index_id = c.index_id)