Friday, March 23, 2012

How to findout if the column is Unique or Key?


I use sp_columns to retrieve colum information of a table.
But, it doesn't return the columns' index information such as Key or Unique..

How can I get these info along with those from sp_columns?

You want to take a look at sp_helpindex, sp_pkeys, sp_foreignkey stored procedures. Also, you want to take a look at info views (i.e. information_schema.*).

No comments:

Post a Comment