Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making FK Constraint to ignore empty records
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01639981
Message ID:
01640008
Views:
55
>I just did a little test, after setting the FK (as per code below). Then I added a couple of records to the EQ_FILE with different value in SITE_NO and NULL in CATEGORY. And no problem; no violation of FK constraint. Does it mean the SQL Server automatically ignores NULL values when checking FK constraints?
>

SQL Server does not enforce FK when any child table column value in FK relationship is null. Which means, when CATEGORY is null, SITE_NO will not be enforced
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform