I have a function that duplicates a record in a table.
The table name and the ID to use for duplication are passed into the function.
I need to return the new ID (the one that has just been created)
Normally I would use:
......code to add record
returnID = !theID
However, theID is a variable... theID is passed into the function as the identity column to duplicate.
How can I return the newly created value for the field theID?