How to find unique key in Sql Server?

Posted by  Samuel Fernandes
 1248  View(s)
Rate this:

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…


  1. Re: How to find unique key in Sql Server?

    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 

      Modified On Apr-11-2018 11:23:58 PM