M. A. Shweikani
Newbie
Points: 1
More actions
March 20, 2004 at 5:42 am
#86300
Dear All
How can I get the Id (this is an identity type column) of an inserted record as part of the insert statement? In Oracle, we used to use the "return Column_name" parameter at the end of the insert statement.
Thank you
Antares686
SSC Guru
Points: 125444
March 20, 2004 at 8:22 am
#499650
Depending on which version of SQL and if wrapped in an SP or submitted together properly you can use
@@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT
With 2000 it is better to use SCOPE_IDENTITY.
See BOL for more info.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply