【SQL Server】インデックス情報取得SQL
select
o.name as 表名,
i.name as Index名,
i.indid as IndexID,
c.name as 列名,
k.keyno
from
sysindexes i,
sysindexkeys k,
syscolumns c,
sysobjects o
where
o.id = c.id
and k.id = i.id
and c.id = k.id
and k.indid = i.indid
and k.colid = c.colid
and o.name in (select name from sysobjects where xtype = 'U')
order by
o.name,
i.indid,
k.keyno
↓ よろしければ、下記ボタンをポチりとお願いしますm(_ _)m

o.name as 表名,
i.name as Index名,
i.indid as IndexID,
c.name as 列名,
k.keyno
from
sysindexes i,
sysindexkeys k,
syscolumns c,
sysobjects o
where
o.id = c.id
and k.id = i.id
and c.id = k.id
and k.indid = i.indid
and k.colid = c.colid
and o.name in (select name from sysobjects where xtype = 'U')
order by
o.name,
i.indid,
k.keyno
↓ よろしければ、下記ボタンをポチりとお願いしますm(_ _)m

スポンサーサイト