In this blog I will explain how to return identity column value in sql server.
Step 1: Create a table with Info name.
I'm inserting into an SQL Server table with an autoincrementing key field.
CREATE
TABLE
[dbo].[info](
[Id] [int]
IDENTITY(1,1)
NOT
NULL,
[name] [nvarchar](50)
NULL,
[Phone] [int]
NULL
)
ON
[PRIMARY]
GO
Inserting into an SQL Server table with an autoincrementing key field
Now executed this query and get recently add identity column
value.
Now again select statement you will see one column add with new id column value.