Properly Capturing Identity Values
January 2, 2008[From MSSQLTips]
When inserting a row into a database table that contains an identity column, I need a way to capture the identity value generated by the database engine after it inserts the row into this table. What can I use to capture this value while also making sure this value is accurate?
SQL Server provides three different functions for capturing the last generated identity value on a table that contains an identity column...
The article continues at http://www.mssqltips.com/tip.asp?tip=1385