Answer: SCOPE_IDENTITY returns the Last Identity Value for any table in the Same Session and the Same Scope.
Syntax:-
Select Scope_Identity();
For Example:-
insert into tbl(col1,col2) values('value1','value2');
Select Scope_Identity();
Output:-Would be Last Inserted Identity Column Value.
Asked In: Many Interviews |
Alert Moderator