get last inserted primary key
snippet in sql

get last inserted primary key

user5832

INSERT INTO dbo.Table(columns)
OUTPUT INSERTED.p_key, INSERTED.someothercolumnhere .......
VALUES(...)