I'm in the process of writing batch loading SQL script and I would like to store the generated primary key of an insert statement into a temp variable and use it to reference the foreign key in the other tables. Any ideas?
I'm doing the following:
Y = INSERT INTO X(.....)
INSERT INTO Z(...,Y,);
I know in SQL Server you can do: