My normal process for inserting into one table and then getting the ID back so that I can insert into another table is like this in MSSQL:
DECLARE @transacti
The getGeneratedKey function at cflib.org can be used with most databases:
Example: insert into artists (firstName, lastName) values('todd','sharp') select * from artists #getGeneratedKey(r)#
Example:
insert into artists (firstName, lastName) values('todd','sharp') select * from artists #getGeneratedKey(r)#