Here is a query that demonstrated how to retrieve primary and foreign key for all tables in a database:
SELECT Table_Name as [Table], Column_Name as [Column],
Constraint_Name as [Constraint], Table_Schema as [Schema]
ORDER BY [Table], [Column]
Did you like this post?
|subscribe via rss||subscribe via e-mail|
|print this post||follow me on twitter|