Press "Enter" to skip to content

Listing Foreign Key References to All Tables

Tom Collins just wants the entire list:

Question: How can I list all Foreign Keys referencing tables and columns within SQL Server tables?

Click through for the script. In addition, it’s easy to modify this script to filter down based on a given table or referenced table, which will probably be more common scenarios than getting all of the key constraints at once.