sql command to get ID (primary key number) of last record inserted

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim in Arizona

    #1

    sql command to get ID (primary key number) of last record inserted

    I forgot what the SQL command was to return the key of the last inserted
    record. Does anyone happen to know what it is?

    Thanks,

    Jim

    --



  • Jeff Dillon

    #2
    Re: sql command to get ID (primary key number) of last record inserted

    "Jim in Arizona" <tiltowait@hotm ail.comwrote in message
    news:OkZ2vywMJH A.1304@TK2MSFTN GP02.phx.gbl...
    >I forgot what the SQL command was to return the key of the last inserted
    >record. Does anyone happen to know what it is?
    Scope_Identity

    http://msdn.microsoft.com/en-us/library/ms190315.aspx

    Jeff


    Comment

    • Jim in Arizona

      #3
      [RESOLVED] Re: sql command to get ID (primary key number) of last record inserted

      Scope_IdentityThanks Jeff!

      Jim


      Comment

      Working...