How to find unique key in Sql Server?

I have 50 tables in a database. I want to fine unique key of all the tables. Is there query to know this or I have to check one by one by opening table structure.

If is it possible then please help me…


Last updated:9/16/2017 6:20:30 AM

1 Answers

Sushant Mishra
Sushant Mishra

There are many method I am telling you using system stored procedure

At a time you can find unique key of single table for every table you have to run different stored procedure 

EXEC sp_special_columns Students

Here students is the table name

when you execute this procedure it will give output