this information_schema view is one way:[INFORMATION_SCHEMA].[CONSTRAINT_COLUMN_USAGE]EDIT:to limit the results to just the constraint types you mentioned then join in with table_constraints:select c.table_name, c.constraint_name, c.constraint_type, u.column_namefrom information_schema.table_constraints cjoin information_schema.constraint_column_usage u on u.constraint_name = c.constraint_namewhere c.constraint_type in ('primary key', 'foreign key')order by 1,3,2,4
Be One with the OptimizerTG