Thursday, February 7, 2008

Let's Talk about .. SQL Server 2005-Foreign Key

Foreign key is used to reference between two tables in the relational database. Foreign key has to be a primary key or the unique key of a referenced table. P'Kaew taught me how to make a relationship between tables in SQL Server 2005.

The instruction about how to create the Foreign key
  1. Right click at which column attribute you want it to be a foreign key.
  2. Click Relationships.
  3. Click Add in the Foreign Key Relationships.
  4. Click the ... button.
  5. Select the table and the attribute to be a foreign key.

No comments: