[sql server 2005] - relationships

  • hello world,

     

    what is the difference between 2 table with a setted relationship, and the same without a relationship setted?

  • it depends on how the relationship is enforced - but in essence

    table a foreign key relates to table b primary key

    table a field that relates cannot have any value that does not exist in table b primary key

    it's a constraint to prevent you entering data that would be incorrect.

    they can also be used to cascade changes - for example cascading deletes mean that if you delete the row in table b, all the rows un table a that have the foreign key value are also deleted.

    MVDBA

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply