Voici ses principaux champs :
Nom du champ | Type du champ | Description du champ |
object_id | int | Identifiant de l'index. |
schema_id | int | Identifiant du schéma de la table. |
column_id | int | Identifiant de la colonne. |
schema_id | int | Identifiant du schéma de la table. |
key_ordinal | int | Numéro de la colonne. |
schema_id | int | Identifiant du schéma de la table. |
SELECT
f.name,
'',
e.name,
c.name,
a.name,
CASE a.is_unique
WHEN 1 THEN 1
ELSE 0
END,
c.name,
d.name,
b.key_ordinal
FROM sys.indexes a, sys.index_columns b, sys.tables c, sys.columns d, sys.schemas e, sys.sysusers f
WHERE
b.index_id=a.index_id
AND b.object_id=a.object_id
AND c.object_id=a.object_id
AND b.object_id=d.object_id
AND b.column_id=d.column_id
AND e.schema_id=c.schema_id
AND f.uid=e.principal_id
AND e.name LIKE 'MonSchema%'
AND c.name LIKE 'MaTable%'
AND ((a.is_primary_key=1) OR (a.is_unique=1))
ORDER BY e.name, c.name, a.name, c.key_ordinal;