是不是这意思:
select 表名=a.name from sysobjects a,sysindexes b
  where b.name like '索引名称' and a.id=b.id

解决方案 »

  1.   

    SELECT name
    FROM sysobjects
    WHERE (id in 
    (select id from sysindexes where name like '%索引%'))
      

  2.   

    --数据库中所有索引及对应的表及字段select 索引名称=a.name
    ,表名=c.name
    ,索引字段名=d.name
    from sysindexes a
    join sysindexkeys b on a.id=b.id and a.indid=b.indid
    join sysobjects c on b.id=c.id
    join syscolumns d on b.id=d.id and b.colid=d.colid
    where a.indid not in(0,255)
    -- and c.xtype='U' and c.status>0 --只要用户表及索引,则加上此条件
    order by c.name,a.name,d.name--如果只要用户表及索引,不要字段,就用:
    select distinct 索引名称=a.name
    ,表名=c.name
    from sysindexes a
    join sysindexkeys b on a.id=b.id and a.indid=b.indid
    join sysobjects c on b.id=c.id
    where a.indid not in(0,255)
    and c.xtype='U' and c.status>0
    order by c.name,a.name
      

  3.   

    为什么日志中显示索引ID号XX错误,但是在SYSINDEXES表中查不到该索ID号呢?