Browse by Tags

In SQL 2008 R2, MERGE does not implement foreign keys properly. I will show both false negatives (valid rows are rejected) and false positives - orphan rows that are allowed to save.
False Negatives
The following tables implement a very common type/subtype pattern:
CREATE TABLE dbo.Vehicles( ID INT NOT ...