If you have worked with SQL Server, you are probably familiar with identity columns. These are equivalent to the "AutoNumber" columns in Access. The main purpose of these columns is to provide a primary key to the table, when a primary key can not be defined using other fields in the table. One of the common questions in the newsgroups is "How can I get the ID of the inserted record in SQL database?" This translates to "How can I get the value of identity column in the inserted record?" In this article, we will see how we can do this in several ways. Also, we will learn a little bit about the columns themselves.
|