Sunday, 30 December 2012

Stored Procedure to find Primary keys and foreign keys of a table.

Here are the Stored Procedures to find the Primary keys and Foreign keys of a table.

1. SP to find Primary keys on a particular table

EXEC sp_pkeys 'Table_Name'

2. SP to find Foreign keys on a particular table

EXEC sp_fkeys 'Table_Name'

No comments:

Post a Comment