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

About randheerparmar

Software engineer fond of traveling, food cricket and sleeping
This entry was posted in SQL Server Interview Questions and Answers. Bookmark the permalink.

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

  1. YSSS says:

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

Leave a comment