Suppose there are 2 tables. One table refers to another through a foreign key, which cannot be NULL. Entety2.Foreign refers to Entity1.Primary .
The key field is of type IDENTITY .
In order to perform an insert, I first create an entry in the main table and perform the save.
Then I create an entry in the second table and do Entety2.Foreign=Entity1.Primary .
Is it right to do this or is there a simpler way to work with dependent tables?