My contemplations and diurnal novelties are publicized here


  • @@Identity
    • Returns the last identity produced on a connection
  • Scope_Identity()
    • Returns the last identity value produced on a connection and by a statement in the same scope.
    • This return the last identity value you explicitly created, rather than any identity created by any trigger.
  • Ident_Current(‘tablename’)
    • Returns the last identity value produced in a table, regardless of connection. It also accounts so roll backed item let say if you have 2 rows insert and two rolled back it will contain 4 instead of 2.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: