Check out example codes for "get last inserted primary key". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com