O'Reilly logo

Visual Basic® .NET Database Programming by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constraints

A constraint is a condition placed on the fields in a database table. For example, you might require that the value in a certain numeric field be between 1 and 100.

A referential constraint is one where a field is related to another field. For example, you might require that the CustomerId field in a new Orders record have a value that matches the CustomerId field in some record in the Customers table. In other words, the database cannot use a CustomerId in the Orders table unless that CustomerId has already been defined in the Customers table. That is sensible because it would be illogical to allow an order without a customer to place the order.

Referential constraints protect the database from garbage data. The user interface ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required