What is difference between SCOPE_IDENTITY & IDENT_CURRENT

Posted by Kundan64 under Sql Server on 1/11/2013 | Points: 10 | Views : 1230 | Status : [Member] | Replies : 1
What is difference between SCOPE_IDENTITY & IDENT_CURRENT, and from where these function taking value?




Responses

Posted by: Raja_89 on: 1/12/2013 [Member] Starter | Points: 25

Up
0
Down
Hai

Scope_Identity

It returns the last identity value generated for any table in the current session the current scope

Example

select scope_identity()


IDENT_CURRENT

It returns the last identity value generated for a specific table in any scope and session.
It is not affected by any session ,scope

Example

I have created a table called eno which has some values eid was identity column

If i want to see the ldentity value for eno

select ident_current('eno')







Kundan64, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response