I was reading an article about a certain bug in SQL 2005 that included a couple of queries to identify some problems with Foreign Keys. The results of the queries showed that I only have five Foreign Keys in my DB and I know there's a lot more than that.
, object_name(i.object_id) as tablename
from sys.foreign_keys f
join sys.indexes i
on i.object_id = f.referenced_object_id
and i.index_id = f.key_index_id
SELECT * FROM sys.foreign_keys
Obviously I'm not understanding something here. Why am I only showing five results when I run these queries on the Master DB?
Thanks in advance for your help.