SCOPE_IDENTITY Returns the last IDENTITY value inserted into an IDENTITY column in the same scope(a stored procedure, trigger, function, or batch).
Example:
Insert Employees(FirstName, LastName) values ('Sharma','Bhupesh')
select @@identity Employees
SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY are similar functions in that they return values inserted into IDENTITY columns
Example:
Insert Employees(FirstName, LastName) values ('Sharma','Bhupesh')
select @@identity Employees
SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY are similar functions in that they return values inserted into IDENTITY columns
No comments:
Post a Comment