userimage
Moe

How to get primary key after inserting a row in a table in microsoft SQL server?

Basically when we insert any row in a table, after insert how to retrieve the primary key associated to the insert done in Microsoft sql server. 
userimage
Moe
To get the primary key we just need to use the SQL statement ' SELECT @@IDENTITY ' to get the primary key immediate after the insert of a record in a table.
Answer is