Difference between IDENT_CURRENT ,@@IDENTITY and SCOPE_IDENTITY ?

 Posted by Senthilstayss on 3/15/2013 | Category: Sql Server Interview questions | Views: 3904 | Points: 40
Answer:

1.When we use the IDENT_CURRENT , it will return the last identity value generated for a specific table in any session and any scope.
2.When we use the @@IDENTITY , it will return the last identity value generated for any table in the current session, across all scopes.
3.When we use the SCOPE_IDENTITY, it will return the last identity value generated for any table in the current session and the current scope.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response