How can I list all foreign keys referencing a given table in SQL Server?

后端 未结 26 3244
梦毁少年i
梦毁少年i 2020-11-22 07:13

I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the foreign key constraints I will need to remove in order to drop the tabl

26条回答
  •  感动是毒
    2020-11-22 07:46

    Also try.

    EXEC sp_fkeys 'tableName', 'schemaName'
    

    with sp_fkeys you may filter the result by not only pk table name and schema but also with fk table name and schema. link

提交回复
热议问题