|
| Total Answers and Comments: 3 |
Last Update: May 03, 2008 Asked by: subbaraovangalli |
|
| | |
|
Submitted by: krishnaindia2007 To add primary key or unique key constraint
Alter table tablename add constraint constraintname primary key / unique (column name)
To add check constraint Alter table tablename add constraint constraintname check (codition)
To add not null constraint Alter table tablename modify (columnname not null)
To add foreign key constraint Alter table tablename add constraint constraintname foreign key(columnname) references referencedtablename(referenced columnname)
Note- We can not add primary key or not null constraint on a column that contains null values. We can not add unique key or primary key constraint on a column that constains duplicate vlaues
Above answer was rated as good by the following members: vanishavadlya | Go To Top
|