Output last inserted row id in TSQL in a stored procedure

It is quite easy to get the last inserted row id in TSQL.

Just create a stored procedure as below.

CREATE PROCEDURE InsertRow
( @parameter1 int, @parameter2 varchar(255), @NewId int OUTPUT )
AS

Read the rest of this entry »

Advertisements