Results 1 to 2 of 2

Thread: Last Identity Value [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Last Identity Value [RESOLVED]

    I am using SQL Server 2000.

    ---

    IDENT_CURRENT returns the last identity value generated for a specific table
    in any session and any scope.

    @@IDENTITY returns the last identity value generated for any table in the
    current session, across all scopes.

    ---

    I need the last identity generated for a specific table for the current
    session. Looks like I can do one or the other, but not both. Or is there a
    way to get it?
    Last edited by simonm; Oct 25th, 2005 at 05:36 AM.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Last Identity Value

    Ah, don't worry.

    SCOPE_IDENTITY will do the trick.
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width