Scope_Identity is the auto generated Id in current context
usage
DECLARE @ID AS BigInt
Set @ID=Scope_Identity()
usage
DECLARE @ID AS BigInt
Set @ID=Scope_Identity()
asp.net, vb.net, sql server, ssrs, expor to excel, export to pdf and javascript related queries