This Procedure will be created in MASTER Database and could be used to see all Candidate Keys of a Specified Table in a Specified DB.
Procedure will take 2 Parameters db_name
and table_name
to display candidate keys of that table .
Command To Run Procedure
exec getPrimaryKeys @db_name = 'PROD_DB' , @table_name = 'Sample_Table'