Can u delete constraints in a table? if yes, how?
Can u delete primary and foreign key?
How to delet columns in a table after creating the table with some data in it?
Can u delete constraints in a table? if yes, how?
Can u delete primary and foreign key?
How to delet columns in a table after creating the table with some data in it?
yes u can drop constraints in a table using 'alter command'
ALTER TABLE emp DROP CONSTRAINT pk_employee
ALTER TABLE foreign_table DROP CONSTRAINT fk_name
Alter table drop column columnname
I think what you are asking is droping not deleting. Since you want to change the structure it is called drop in technical terms not delete. Delete refers to deletion of data only not structure. Since you want to change the structure use alter command as suggested by our expert in the previous post.
Hi Saritha,
You use the fallowing query to see the total information of the table. from that you can use to delete or drop the primary or forign keys.
select * from sysobjects where type='u' and name='tablename';
You can also delete a primary key if you dont know the name of the primary key by saying:
Code:ALTER TABLE table_name DROP primary key