Thursday, May 5, 2011

Obtaining Identity Column Values in SQL Server

When you enter a new record into a table that contains an identity column, the identity value will be set with the next available identity value. Lots of times your database design requires you to obtain the value that was used to set the identity column. The identity value will be used to populate other tables that need to have a foreign key relationship with the inserted record. Therefore you need to be able to return the identity column value of the newly inserted record.


http://www.databasejournal.com/features/mssql/article.php/3931466/Obtaining-Identity-Column-Values-in-SQL-Server.htm

No comments:

Post a Comment