0

I know how to delete a constraint but what about deleting a constraint that has not been named.

Here I have used a Check constraint without name.

Example:

create table customers
(
 id int not null,
  name varchar(50) not null,
  age int not null check (age>=18),
  [Address] char(50),
  salary decimal(18,2),  
   primary key (id)
    );

I tried using following command

 alter table customers drop check (age)

But, it gives incorrect syntax error.

Is there a simple way to drop a constraint that is not name?

Sam
  • 7,252
  • 16
  • 46
  • 65
user2128482
  • 35
  • 2
  • 8

1 Answers1

0

i found someone who have the same problem and solved it !

Take a look here :>

How to drop SQL default constraint without knowing its name?

Community
  • 1
  • 1
e1che
  • 1,241
  • 1
  • 17
  • 34