---
title: "How to Drop Primary Key Constraint"  
description: "How to Drop Primary Key Constraint"  
author: "AVADHESH PATEL"  
published: 2012-09-27  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/1017/how-to-drop-primary-key-constraint  
category: "database"  
tags: ["database"]  
reading_time: 1 minute  

---

# How to Drop Primary Key Constraint

Here I described how to drop [primary key](https://www.mindstick.com/blog/474/remove-primary-key-from-access-table) form table. There are two way for doing this.\

One is when we are not providing [constraint](https://www.mindstick.com/blog/174/foreign-key-self-reference-constraint) key name during creating table.

[Second](https://yourviews.mindstick.com/view/82433/the-second-wave-new-covid-19-vs-old-covid-19) is given constraint name during creating table.

##### Without giving constraint key

First create a [table in SQL](https://www.mindstick.com/forum/205/find-the-all-column-with-schema-for-any-table-in-sql-server) server with primary key only like below code.

```
create table info
(
id int primary key,
[name] varchar(50) not null,
address varchar(50) not null
)
```

Copy the key value from created table ‘Keys’. This key [automatic](https://answers.mindstick.com/qa/45147/what-is-the-rule-relating-to-automatic-suspension-of-a-member) created by [sql server](https://www.mindstick.com/articles/34/create-table-in-microsoft-sql-server).

![How to Drop Primary Key Constraint](https://www.mindstick.com/mindstickarticle/c7c850d7-9a60-4dcc-af6b-9dabc7cd8096/images/00a95b19-bb7c-4d23-94e3-a5d759b0231f.png)

Write code for drop primary key

\

```
alter table info drop PK__info__1A14E395
```

With giving constraint key

Create table like below

```
create table info
(
id int,
[name] varchar(50) not null,
address varchar(50) not null
constraint pk_info_id primary key clustered(id asc)
)
```

Drop primary key

```
alter table info
drop pk_info_id
```

---

Original Source: https://www.mindstick.com/articles/1017/how-to-drop-primary-key-constraint

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
