The Information Schema TABLE_CONSTRAINTS table contains information about tables that have constraints.

It has the following columns:

ColumnDescription
CONSTRAINT_CATALOGAlways def.
CONSTRAINT_SCHEMADatabase name containing the constraint.
CONSTRAINT_NAMEConstraint name.
TABLE_SCHEMADatabase name.
TABLE_NAMETable name.
CONSTRAINT_TYPEType of constraint; one of UNIQUE, PRIMARY KEY or FOREIGN KEY.

The REFERENTIAL_CONSTRAINTS table has more information about foreign keys.

Comments

Comments loading...