How do I drop a foreign key in SQL Server?

前端 未结 8 1784
别那么骄傲
别那么骄傲 2020-12-04 10:53

I have created a foreign key (in SQL Server) by:

alter table company add CountryID varchar(3);
alter table company add constraint Company_CountryID_FK foreig         


        
相关标签:
8条回答
  • 2020-12-04 11:17

    You can also Right Click on the table, choose modify, then go to the attribute, right click on it, and choose drop primary key.

    0 讨论(0)
  • 2020-12-04 11:18

    Try

    alter table company drop constraint Company_CountryID_FK
    
    
    alter table company drop column CountryID
    
    0 讨论(0)
提交回复
热议问题