What is referential integrity and how can we achieve it?

Q

What is referential integrity and how can we achieve it?

✍: Guest

A

Referential integrity preserves the defined relationships between tables when records are entered or deleted. In SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys. Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to nonexistent values and that if a key value changes, all references to it change consistently throughout the database.
We can achieve this by using foreign key.

2014-10-20, 1568👍, 0💬