Monday, May 11, 2015

Last generated Identity column value in SQL Server



Last generated Identity column value in SQL Server

·         SCOPE_IDENTITY () – Same session and the same scope.    Ex:- select SCOPE_IDENTITY()

·         @@IDENTITY – Same session and across any scope.      Ex:- select @@IDENTITY

·         IDENT_CURRENT(‘TableName’) – Specific table across any scope and any session.   Ex:- select IDENT_CURRENT('test')

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.