Cloud Training (Online)




SQL Server 101 – Get the identity of inserted row

If you are looking at a way to find the identity of the inserted row in SQL Server , you can use the SCOPE_IDENTITY().

How to get the identity of the inserted row in SQL Server ?

SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY are similar functions because they return values that are inserted into identity columns.

The difference is that SCOPE_IDENTITY() returns the last identity value generated for any table in the current scope.

SELECT SCOPE_IDENTITY()
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.