Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. @@identity

@@identity

Scheduled Pinned Locked Moved Database
databasetutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yazan_zahi
    wrote on last edited by
    #1

    how to use the @@identity function in stored procedure pls

    C S 2 Replies Last reply
    0
    • Y yazan_zahi

      how to use the @@identity function in stored procedure pls

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      yazan_zahi wrote:

      how to use the @@identity function in stored procedure pls

      Same way as you'd use it anywhere else. You might, however, find that SCOPE_IDENTITY() is a better choice if you have a lot of other database interaction going on at the same time.


      Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      1 Reply Last reply
      0
      • Y yazan_zahi

        how to use the @@identity function in stored procedure pls

        S Offline
        S Offline
        SeMartens
        wrote on last edited by
        #3

        Hi, what do you want to exactly with this, or better how do you want to use it? I think for storing it into another variable you can something like: SELECT @@identity into @myVariable or using it within a query SELECT * FROM my_table where my_PK = @@identity Hope this helps, regards Sebastian

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups