Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi how to find the foreign key and primary key from a database using query

in sql server 2005?

say the query for finding foreign key and primary key from database.
Anybody know the answer update..
Posted
Updated 28-Jun-11 0:50am
v3

Have a look at this[^] link.
 
Share this answer
 
v2
 
Share this answer
 
Execute this below query to find Primary Keys and Foreign Keys from database
Select * From SysObjects Where xType IN ('PK', 'F')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900