Home Forums Programming General Can I return an identity value to be used in an insert trigger on a table? RE: Can I return an identity value to be used in an insert trigger on a table?

  • I'll back up a bit.

    In a single transaction, a material and a material_prod_version record will be inserted.

    Each record has its own identity column.

    The material_prod_version record has a column for the identity value of the material, but it is not filled.

    I would like that column to be filled with the identity of the material so that I can do a join based on the pk, rather than the business keys.

    It seems that since this is all done in a single transaction, that the data would be available to me somehow in the trigger.

    The only reason I'd like to get the identity at the time of insert, is that it saves me a read to the database to retrieve the data.