I have 2 tables with a one to one relationship. I need to insert information into these two tables using the same primary key that is unused. I have the first table being inserted into with a simple insert into query. Is there a way to grab the primary keys of the records after they are inserted and the primary key is auto incremented? I do not think it is safe to just add to the 2nd table because the some records dont have their 2nd table counterparts.
Is it safe to query for the bottom x values based on the query used to insert?
The values are coming from a source table that has fields A, B, C, D, E, and F
Table1 has fields id1, A, C, E, and F and Table2 has fields id2, B, and D. id1 and id2 are equal but not the same as the id from the source table