SORU
18 EYLÜL 2008, PERŞEMBE


Nasıl SQL Server yabancı bir anahtar düşüreceğim?

Yabancı bir anahtar oluşturdum (SQL Server):

alter table company add CountryID varchar(3);
alter table company add constraint Company_CountryID_FK foreign key(CountryID) 
references Country;

Ben daha sonra bu sorguyu çalıştırın:

alter table company drop column CountryID;

hata:

5074, Düzey 16, 4, 2 Satır Devlet Msg
Nesne '' sütun bağlıdır''. CountryİD Company_CountryİD_FK
4922, Düzey 16, 9, 2 Satır Devlet Msg
ALTER TABLE DROP COLUMN CountryİD bir veya daha fazla nesne erişmek için bu sütun başarısız oldu

Bunu denedim, ama çalışmak için görünmüyor:

alter table company drop foreign key Company_CountryID_FK; 
alter table company drop column CountryID;

Ben CountryID sütun silmek için ne yapmak gerekiyor?

Teşekkürler.

CEVAP
18 EYLÜL 2008, PERŞEMBE


Deneyin

alter table company drop Company_CountryID_FK


alter table company drop column CountryID

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Best Quality Cartoons

    Best Quality

    10 ŞUBAT 2014
  • CMTelly

    CMTelly

    2 Mayıs 2007
  • isupportthegosselins

    isupporttheg

    6 Aralık 2009