Does anybody know of a way to pass the number that an INSERT generated
with an identity column to an outside query?
If we were inserting a whole bunch of records into a table, I want to
also insert 1 record in a control table and use it's returned identity
value as a column value in my insert.
I know the following syntax is ridiculous, however it illustrates the
Assume there is a trigger on the table CONTROL that returns the identity
value from the logical inserted table
INSERT INTO LOTSOFRECORDS
((INSERT INTO CONTROL GETDATE()),myValue,WhatEverOtherValues)
^ This insert would generate a returned Identity column