Introduction:
Here I will explain difference between @@identity, scope_identity and ident_current in sql server with example. Generally @@identity, scope_identity and ident_current properties in sql server is used to get identity / id value of last or newly inserted record in table but only difference is scope either local or global and session either current session or other session in sql server.
Description:
In
previous posts I explained cursor with example in sql server, difference b/w stored procedure and
function in sql server, handle exceptions in sql server, difference between page_init and
page_load events in asp.net, difference between ref and out
parameters in c#, constructors in c#, vb.net with
examples,
delegates in c# with example, difference between len and datalength
in sql server
and many articles relating to interview questions, asp.net, c#.net. Now I will explain
difference between @@identity, scope_identity and ident_current in sql
server
with
example.