---
title: "How to find unique key in Sql Server?"  
description: "How to find unique key in Sql Server?"  
author: "Samuel Fernandes"  
published: 2017-09-16  
updated: 2017-09-16  
canonical: https://www.mindstick.com/forum/34344/how-to-find-unique-key-in-sql-server  
category: "database"  
tags: ["sql server", "sql server 2008", "sql server 2012"]  
reading_time: 1 minute  

---

# How to find unique key in Sql Server?

I have 50 [tables](https://www.mindstick.com/articles/336597/introduction-of-html-tables-for-web-development) in a database. I want to fine [unique key](https://answers.mindstick.com/qa/116303/explain-database-primary-key-vs-unique-key) of all the tables. Is there [query](https://www.mindstick.com/blog/202/sub-query-in-sqlserver) to know this or I have to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) one by one by opening [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) structure.

If is it possible then please help me…

Thanks..

## Replies

### Reply by Sushant Mishra

There are many method I am telling you using system stored procedure

At a time you can find [unique](https://www.mindstick.com/blog/12870/how-to-be-unique-in-business) 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

![How to find unique key in Sql Server?](https://www.mindstick.com/mindstickforums/8a5809ef-a0b4-4859-acfd-f840faf6156e/images/1a3df892-6ce1-4cc0-981a-ca530dd4b802.png)\


---

Original Source: https://www.mindstick.com/forum/34344/how-to-find-unique-key-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
