Thursday, July 28, 2011

How to Get the Primary Key and foreign Key between two tables

These are the few tables which can be used to check the foreign key and primary key column in a table.

It will give both columns from both tables.

INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS  
INFORMATION_SCHEMA.TABLE_CONSTRAINTS
INFORMATION_SCHEMA.KEY_COLUMN_USAGE

1 comment:

  1. Can you please give the example more detailed level please..!!

    ReplyDelete