Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
制約チェックをオフにしたバルクロードの後、制約に違反しているため、外部キー列のいくつかのレコードを削除する必要があります。DBCCはそれらをうまく示していますが、この[colARef] ='XXX' DBCC表記の違反値を取得する簡単な方法はありますか?つまり、解析せずに、主キーを検索して削除できる値を取得します。 ありがとう
DBCC出力をまったく見なくても、次のような制約違反を見つけることができます。
select * from ReferencingTable t1 where not exists ( select * from ReferencedTable t2 where t1.ForeignKeyColumn = t2.Id )