SCOPE_IDENTITY() is the scoped identity function, and returns the last-inserted identity value; although not actively harmful like @@identity,
it still has limitations (in particular: single-row vs multi-row insert) and is indirect; it is worth considering use the OUTPUT clause.
Bad:
insert SomeTable (A) values (1)
select @@identity
Better:
insert SomeTable (A) values (1)
select SCOPE_IDENTITY()
Best:
insert SomeTable (A)
output inserted.Id
values (1)