Thursday, 23 July 2015

Difference between IDENT_CURRENT, @@IDENTITY, SCOPE_IDENTITY in sqlserver ?

  • IDENT_CURRENT returns the last identity value generated for a specific table in any session and any scope.
  • @@IDENTITY returns the last identity value generated for any table in the current session, across all scopes.
  • SCOPE_IDENTITY returns the last identity value generated for any table in the current session and the current scope.

No comments:

Post a Comment

Thanks for comments.