© Dmitri Korotkevitch 2016

Dmitri Korotkevitch, Pro SQL Server Internals, 10.1007/978-1-4842-1964-5_8

8. Constraints

Dmitri Korotkevitch

(1)Tampa, Florida, USA

It is important to design databases in a way that makes efficient processing and querying of the data possible. That by itself, however, is not enough. We must make sure that the data we get from the database can be trusted. Think about an Order Entry system, for example. We can query the OrderLineItems table to get the information about products we sold, but we cannot trust the results unless we know that the table has no orphaned rows that do not belong to any orders in our system.

Constraints allow us to declare the data integrity and business rules for the database and have SQL Server ...

Get Pro SQL Server Internals, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.