@@identity
-
how to use the @@identity function in stored procedure pls
-
how to use the @@identity function in stored procedure pls
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
-
how to use the @@identity function in stored procedure pls
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 querySELECT * FROM my_table where my_PK = @@identity
Hope this helps, regards Sebastian