I will post some of my findings about trusted foreign keys and constants here since this has become a minor issue at work. First we need to see if we have any untrusted foreign key constraints. We can see them by running the following query:
1 2 3 4 5 6 |
USE mydatabase GO SELECT * FROM sys.foreign_keys WHERE is_not_trusted = 1; |
(more to come)
References
Can you trust your constraints?
Blitz Result: Foreign Keys or Check Constraints Not Trusted
Views – 1945