Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
別のテーブルと外部キー関係にあるテーブルがあります。
この関係が存在する場合は、それを削除することを確認したいと思います。
このクエリの書き方。
ありがとう。
SQL Serverを使用している場合、これは機能するはずです
if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FKName]') AND parent_object_id = OBJECT_ID('TableName')) alter table TableName drop constraint FKName