Hi. I need to insert a number of new records using a transaction. The script will be something like:
Create new record in Table1.
Create new records in Table2, with Table2FK linked to Table1PK
Create new records in Table3, with Table3FK linked to Table2PK
...
Is is possible to create a transaction which spans over a number of linked tables like that? I've been told that Table1PK is not really created until the transaction is commited, but that means I can't link the FK in the child tables until after the parent table's PK commits.
Create new record in Table1.
Create new records in Table2, with Table2FK linked to Table1PK
Create new records in Table3, with Table3FK linked to Table2PK
...
Is is possible to create a transaction which spans over a number of linked tables like that? I've been told that Table1PK is not really created until the transaction is commited, but that means I can't link the FK in the child tables until after the parent table's PK commits.