Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Thank you:) I guess I had assumed too much from the relational database system:) Knowing my limits helps to see what I need to do:)
>No, relation databases doesn't mean that it will add records to your tables automatically. It just ensure, via relational integrity, that the database will allways be consistent. If you go in the relational integrity form in the database designer and go on the Rules for Inserting tab, you will see only 2 choices: Restrict and Ignore. That only mean that you can restrict adding a child without a parent or admit it. Nowhere it offer you to add childrens automatically.
>
>Even if it could, how will it do that? What value will it put in the different fields of the child? A parent can have zero or many childs. How does the database know that? By specifically inserting as many child that you need in the child table.
>
>BTW, don't forget to use transactions (BEGIN TRANSACTION, ROLLBACK, END TRANSACTION) when playing with parent-child scenario. That way, if something go wrong after you added a child, the database will not be left in a unconsistent state.
>
>HTH
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement