Thursday, January 2, 2014

SCOPE_Identity() Vs @@Identity Vs Ident_Current()

Scope_Identity:-Return the last generated identity column value within the same scope and same session.

For e.g. Customer Table with column (Id int identity(1,1),Name nvarchar(50))


@@Identity:Return the last generated identity column value across any scope and same session.

IDENT_CURRENT('TableName'):-Return the last generated identity column value across any scope and any session.


No comments:

Post a Comment