• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. SQL Server Tables and Databas... > Establishing Referential Integrity

Establishing Referential Integrity

As you can see, establishing a relationship is quite easy. Establishing the right kind of relationship is a little more difficult. When you attempt to establish a relationship between two tables, SQL Server makes some decisions based on a few predefined factors:

  • A one-to-many relationship is established if one of the related fields is a primary key or has a unique index.

  • A one-to-one relationship is established if both the related fields are primary keys or have unique indexes.

  • A relationship cannot be created if neither of the related fields is a primary key and neither has a unique index.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint