Wednesday, May 21, 2014

Get Identity after inserting into database in Ms. SQL Server

Suppose we have a table named tblUser with coloumn name
Id int auto increment primary key
Name nvarchar(255)
Email nvarchhar(255)

Now after inserting a value into tblUser an Id will automatic generate as Id. Now how will you retrieve that Id. Very simple.

After inserting code place the bellow code


This one will return you the Id of the inserted row.


Post a Comment

Follow by Email

Popular Posts