日期:2014-05-16 浏览次数:20420 次
Select constraint_name, search_condition From USER_CONSTRAINTS Where table_name = 'your table name';
Alter Table your_table Drop Constraint constraint_name; constraint_name是上一条语句查出来的
--非空 Alter Table your_table Modify field_name NOT NULL; --主键 Alter Table your_table Add Constraint tb_pk Primary Key( field_name ); --外键 Alter Table your_table Add Constraint tb_fk Foreign Key( field_name ) References your_table2(field_name);
修改字段的默认值 Alter Table tbl_name modify col_name default(col_value);