Home  /  Questions  /  Question

50   50
May 11, 2015

Retrieve Primary Key Value

How do I insert a new record and then retrieve the primary key value?

50   50
Jun 25, 2015
You query is open ended. So difficult to get.

508   99.9
Jul 16, 2015

In SQL Server issue SELECT SCOPE_IDENTITY() following the INSERT statement.
This will return the newly created Identity primary key. 

Hope this helps.