@@IDENTITY - does it make DB call

  • I would like to know if select @@IDENTITY actually goes back and makes a new database call or selects only from the client connection/cache/table????

    where does exactly it takes the value from?

    It seems to me that it'll go to the database/table but if this is true statement?

    I would have a problem if it's a database call from the application...

    Thanks a lot.

    mj

  • yes - @@IDENTITY will give you the last inserted id in an identity column in the database - but this could be any identity column in the entire database - not necessarily a particular table that you may want to query - (for that you would use IDENT_CURRENT())







    **ASCII stupid question, get a stupid ANSI !!!**

  • I know I can get somebody's else inserted identity - this is fine...

    My problem is that I'm not allow to make more then 5 calls to the database - if the @@identity is count as database call - goes back to the database to puul it from there, these are 2 more calls for me...

    too bad...

    I made a trace and I can see it there as a call too...

    Thanks a lot...

  • why don't you have a stored procedure return the value to you so you can reduce the number of trips to the db ?!







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply