SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Procedure to Find Candidate Keys

By Sheraz Mirza,

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'

Total article views: 564 | Views in the last 30 days: 3
 
Related Articles
FORUM

need help about procedure

procedure

FORUM

help in my procedure

Procedure

FORUM

create Procedure within Procedure

create Procedure within Procedure

FORUM

Procedures

Stored procedures permissions

FORUM

Procedure

Proceduralize Bulk Insert Quote

 
Contribute