I have a SQL Server 2000 database with approximately 220 tables. These tables have a number foreign key relationships between them. Through performance analysis, we’ve discovered a number of these foreign key relationships are missing indexes. Instead of being reactive to performance problems, I’d like to be pro-active and find all foreign keys that are missing indexes.
How can I programmatically determine which foreign key are missing indexes?
Here is an answer that works for SQL Server 2000 authored by a co-worker: