I have several SQL Server 2005 databases with untrusted foreign keys. These keys are marked as "Not for Replication" (is_not_for_replication=1
) in the sys.foreign_keys
object catalog view.
I have run a script that captures these untrusted keys and runs
ALTER TABLE [tablename] WITH CHECK
CHECK CONSTRAINT [keyname]
against each key. For all but one the results say that these keys have been validated (re-trusted?), but the sys.foreign_keys
view still has them marked as untrusted.
Why is this object catalog view not reflecting the "re-trusted" keys as is_not_trusted=0
? Is a "Not for Replication" foreign_key always untrusted? If not, how do I get the catalog view to reflect the "trusted" state of the foreign key?
また、外部キーが「信頼されていない」とマークされている限り、SQL Server 実行計画に組み込まれないと仮定しても正しいでしょうか?
コメントや提案をありがとう。