Home > Code > SQL Server > How to drop constraints in the sql server table?

How to drop constraints in the sql server table?

by Thamil   on Jan 17, 2012   Category: SQL Server   |  Views: 1094    |  Points: 25   |  Gold 


we can use alter syntax to drop constraints in the sql server table, see the below sample constraints in the table and how to drop by using alter syntax.

create primary constraint:

CREATE TABLE testtbl(
colm1 int NOT NULL,
colm2 VARCHAR(50),
CONSTRAINT PK_colm1 PRIMARY KEY (colm1)
);

drop primary constraint:


ALTER TABLE testtbl DROP CONSTRAINT PK_colm1;


Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts