Click here to Skip to main content
15,914,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am surprise of that foreign key can refer to null value on its reference table in sql server.I would appreciate if someone explain this to me with simple example.
Thank you
Posted

1 solution

Why shouldn't they have null values? Primary keys can't because null is not a unique value - which is a requirement of a Primary key[^]. A Foreign key[^] just relates a row in one table to a unique row in another table, and so can be null when no such row exists.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900