Drop A Check Constraint

来源:百度知道 编辑:UC知道 时间:2024/06/02 10:04:56
I applied a check constraint to a column as

CREATE TABLE PARTY_MASTER (
Party_Id int PRIMARY KEY,
Party_Name varchar(20) NOT NULL,
Party_Addr_Id int FOREIGN KEY references PARTY_ADDRESS(Party_Addr_Id),
Zone varchar(5),
Status char(1) CHECK (Status IN ('A','I')),
Effective_Date datetime NOT NULL CHECK (Effective_Date > '12/01/2007'))

Now I want to drop the check constraint on column 'Effective_Date'. But I could not find any query which shows how to drop a check constraint without a 'Constraint Name'.

不指定constraint_name删不了
oracle可以从user_constraints或user_col_constraints里获得constraint_name

或者采用先删除那个column
alter table table_name drop column column_name
然后再重新加一下那个column
alter table table_name add column_name ...;