Below are revisions for this snippet.

MSSQL Return Identity after Insert





Syndication

Revision Revison 1
Often when inserting information in a database we need to know the value of the autonumber/identity field so that we can insert related data in another table. MSSQL Server provides a SCOPE_IDENTITY() function for just such a purpose (PHP/MySQL users have the mysql_insert_id() function -- lucky).

*This is in the generic section because there is no MSSQL Server or Database section.