Sunday 26 January 2020

Difference between SCOPE_IDENTITY(), @@IDENTITY and IDENT_CURRENT()

Hi All,

Hope you all are doing good.

In this article, we will know about when to use below ones.
  • SCOPE_IDENTITY()
  • @@IDENTITY 
  • IDENT_CURRENT()

NameSyntaxDescription
SCOPE_IDENTITY()Select SCOPE_IDENTITY()returns the last identity value that is created in the same session and in the same scope.
@@IDENTITYSelect @@IDENTITYreturns the last identity value that is created in the same session and across any scope.
IDENT_CURRENT()Select IDENT_CURRENT('tbl_name')returns the last identity value that is created for a specific table across any session and any scope.

Thanks for reading my article.

No comments:

Post a Comment

Intoduction to Flutter

Hi All, I hope every one is doing good In this article, we will know about the introduction of Flutter.