List most referenced tables (by FK) in SQL Server database

Query below lists tables that are most referenced by other tables with foreign keys. Those are the dictionary tables such as person, product or store. In data warehouses those are dimension tables.

See also:


select schema_name(tab.schema_id) + '.' + as [table],
   count( as [references],
   count(distinct fk.parent_object_id) as referencing_tables
from sys.tables as tab
   left join sys.foreign_keys as fk
       on tab.object_id = fk.referenced_object_id
group by schema_name(tab.schema_id),
having count( > 0
order by 2 desc


  • table - name of the table with schema name
  • references - number of foreign keys referencing to this table
  • referencing_tables - number of different tables referencing to this table


  • One row represents one table in a database
  • Scope of rows: tables being used in foreign keys as primary key table
  • Ordered by number of foregin keys descending

Sample results

List of most referenced tables in AdventureWorks database. Production.Product table is referenced 14 times from 13 different tables.

There are no comments. Click here to write the first comment.