Prepare for your Next Interview
This is a discussion on How to alter the primary column within the SQL forums, part of the Databases category; Alter perform on primary key column please give me the query for how to alter the primary column from the table....
|
|||
|
Re: How to alter the primary column
Through Alter command we can add or drop primary key
examples ALTER TABLE emp ADD CONSTRAINT empno_pk PRIMARY KEY (empno); To add primary key to existing table ,we must take care that primary key column field(fields) must be not null and not duplicate. To Drop primary key: alter table emp drop constraint empno_pk |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to alter a type in SQL | Geek_Guest | SQL | 8 | 02-06-2008 03:51 AM |
| Column for Primary Key | viveksqa | SQL | 3 | 01-23-2008 06:13 AM |
| 2 tables with no primary key | pdave | SQL Server | 3 | 01-17-2008 04:51 AM |
| Restrictions with Alter command | fred | SQL | 3 | 09-04-2007 12:35 AM |
| Can we set the primary key for item_master | yusuf_sagari | Oracle | 1 | 05-11-2007 07:11 AM |